add a mousedown event to a cell at table layout

  • hi,

    is it doable to add a mousedown event listener to a cell at table layout where cell is simply
    an image in a div or span ?

    I have a panel with tablelayout where a cell is an image insdie a span, when I click the span/image, it takes some delay for the click event handler to response, so adding 'mouse
    down' event listener may help to trigger some ui change, or may just use 'mousedown' event
    instead of 'click' event. If the listeners can be added onto a cell, I don't need to have a div
    or span carry the listeners.

    m_Zoom_Win_ = new Ext.Panel({
    renderTo: 'win-zoom-slider-horiz',
    layout:'table',
    ...
    defaults: {
    // applied to each contained panel
    // bodyStyle : "background-color:transparent; border-color: #ffffff;",
    bodyStyle:'padding:0px'
    },
    layoutConfig: {
    // The total column count must be specified here
    columns: 5
    },
    items: [
    {
    html: ''
    }
    ...

    ,{
    html: '


  • You can listen on panel's body. To test it, navigate to http://examples.extjs.eu/tblayout.html and then type in firebug's console: Ext.getCmp('tblayout-win').items.itemAt(4).body.on('click', function() { alert('click') });

    Now, if you click "cell 5" you get the alert.







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about add a mousedown event to a cell at table layout , Please add it free.

    7 January 2009 | cameltoepants.com | edit