1. #1
    Ext JS Premium Member
    Join Date
    Aug 2010
    Location
    The Netherlands
    Posts
    93
    Vote Rating
    0
    rkaat is on a distinguished road

      0  

    Default Retrieve the field/dataindex with 'celldblclick'. (Gridpanel)

    Retrieve the field/dataindex with 'celldblclick'. (Gridpanel)


    Hey,

    I got a question about retrieving the dataindex/field when using celldblclick. At the moment I got a grid with a couple of columns. When I double click on a cell I would like to see more information of a specific person for example.

    Now, the person's name is in column 1, so I can just use:
    PHP Code:
    var openNewTab = function(gridrowIndexcolumnIndexe){
         if (
    columnIndex == 1){
            
    //Show more information...
         
    }

    But when I re-order the columns in my grid I have to to double click the gender for example to see for information about the person, because I re-ordered my grid so that the column gender in the first column in my grid. I want to check if the user actually clicked on a person's name instead of checking the columnIndex.

    Is there a way to retrieve the column's dataindex or fieldname in the celldblclick event (or maybe another event which is triggered when clicking on a cell) ?

  2. #2

  3. #3
    Sencha - Community Support Team Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246
    Vote Rating
    83
    Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of Condor has much to be proud of

      0  

    Default


    Code:
    var dataIndex = grid.getColumnModel().getDataIndex(columnIndex);
    var record = grid.getStore().getAt(rowIndex);
    var value = record.get(dataIndex);

  4. #4
    Ext JS Premium Member
    Join Date
    Aug 2010
    Location
    The Netherlands
    Posts
    93
    Vote Rating
    0
    rkaat is on a distinguished road

      0  

    Default


    Stupid of me, I should have known that. Anyway, thanks for the quick replies.

Similar Threads

  1. Replies: 4
    Last Post: 13 May 2010, 9:27 PM
  2. Smarter cellclick/celldblclick?
    By jarlau in forum Ext 3.x: Help & Discussion
    Replies: 5
    Last Post: 27 Aug 2009, 1:48 AM
  3. Getting value while celldblclick in grid
    By frank_ash in forum Ext 2.x: Help & Discussion
    Replies: 9
    Last Post: 1 Apr 2009, 2:21 AM
  4. GridPanel Sorting Columns By Value Other Than DataIndex
    By cybersprocket in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 4 Feb 2009, 12:33 PM
  5. how to distinct editorGrid's cellclick from celldblclick
    By lixiaoxu85 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 28 Apr 2008, 7:13 PM

Thread Participants: 2

Tags for this Thread