1. #1
    Ext User
    Join Date
    Mar 2009
    Posts
    6
    Vote Rating
    0
    Harish kumara is on a distinguished road

      0  

    Default How can i add double click event to my grid

    How can i add double click event to my grid


    hi all,
    am beginner to extjs. my project is to display the file information in the grid when we double click the any entry in the grid it should invoke a function which will take care of displaying that file. I have done single click but don't know how to implement double click..
    myGrid= new Ext.grid.GridPanel({
    ----------------------
    ----------------------
    });
    myGrid.addListener('rowclick', displayFile);

    I have tried this one but did'nt get any effects on my project..
    myGrid.addListener('rowdbclick',displayFile);

    please give solution to my problem...

    thank you,

    regards,
    harry

  2. #2
    Sencha User conorarmstrong's Avatar
    Join Date
    Mar 2008
    Location
    Northern Ireland
    Posts
    224
    Vote Rating
    2
    conorarmstrong is on a distinguished road

      0  

    Default


    use something like

    Code:
    // assuming you have a grid called someGrid
    
    someGrid.on('rowdblclick', function(g, i, e) {
    // g is the grid
    // i is the index
    // e is the event
    
    // for example if store had a name field then
    var name=g.getStore().getAt(i).get('name');
    // would get it                        
    }
    hope this helps!
    ------------------------------------------
    Conor Armstrong
    tw: @evathedog
    web: rockstown.com

    Ext.ux.form.AutoCombo
    Ext.ux.SimpleIFrame
    Ext.ux.form.ToolFieldSet

    Knowledge is realising that the street is one-way, wisdom is looking both directions anyway.

  3. #3
    Ext User
    Join Date
    Mar 2009
    Posts
    6
    Vote Rating
    0
    Harish kumara is on a distinguished road

      0  

    Default


    Quote Originally Posted by conorarmstrong View Post
    use something like

    Code:
    // assuming you have a grid called someGrid
     
    someGrid.on('rowdblclick', function(g, i, e) {
    // g is the grid
    // i is the index
    // e is the event
     
    // for example if store had a name field then
    var name=g.getStore().getAt(i).get('name');
    // would get it                        
    }
    hope this helps!
    --------------------------------------------------------------------------------

    I think you did not get my question I tried what you suggest but its not working let me explain you with example...if i do this its working its giving message "am beginner"

    FilesListingGrid.on('rowclick',function(g,i,e){Ext.MessageBox.alert('am beginner');});

    but its not working when I give as 'rowdbclick'

    FilesListingGrid.on('rowdbclick',function(g,i,e){Ext.MessageBox.alert('am begginer');});

    What I supposed to do???

  4. #4
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    672
    Vote Rating
    20
    carol.ext will become famous soon enough carol.ext will become famous soon enough

      0  

    Default


    but its not working when I give as 'rowdbclick'
    That's not spelled right.

    It's 'rowdblclick'

  5. #5
    Ext User
    Join Date
    Mar 2009
    Posts
    6
    Vote Rating
    0
    Harish kumara is on a distinguished road

      0  

    Default


    thank you very much carol i got it

Thread Participants: 2