1. #1
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    53
    Vote Rating
    1
    eja40 is on a distinguished road

      0  

    Default A plea!!! How to specify onCellClick - specification changed?

    A plea!!! How to specify onCellClick - specification changed?


    It used to be the case in Ext JS 3 that this would work on a grid:

    Code:
        mygrid.on('cellClick', function(grid, rowIndex, columnIndex, e) {
            var record = grid.getStore().getAt(rowIndex);  // Get the Record
            var fieldName = grid.getColumnModel().getDataIndex(columnIndex); // Get field name
            var data = record.get(fieldName);
        });
    But now in Ext JS 4 the handler function is specified differently (NOT: grid, rowIndex, columnIndex, e) and I have no idea how to figure out how I should be implementing this. All I want to do is to get the data for the cell that has been clicked!!

    Surely somebody must have some working code they could kindly share on implementing this or a similar grid event handler in Ext JS 4?

    Many thanks.

  2. #2
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,360
    Vote Rating
    81
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Here are the arguments passed, from what I can tell:

    grid, cellEl, cellIdx, record, rowEl, rowIdx, evtObj


    you can access the headers property via the grid panel. From there, you can use something like:


    console.log ( record.get(this.headers[cellIdx].dataIndex) )

  3. #3
    Ext JS Premium Member
    Join Date
    Apr 2011
    Posts
    53
    Vote Rating
    1
    eja40 is on a distinguished road

      0  

    Default


    Thank you so much - you don't know how many hours I have lost on this problem! Ah the joys of developing with beta!

Similar Threads

  1. Where is the Ext.Direct specification page?
    By pjs in forum Ext.Direct
    Replies: 0
    Last Post: 4 Feb 2011, 6:30 AM

Thread Participants: 1