-
5 Apr 2011 1:12 PM #1
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:
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!!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); });
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.
-
5 Apr 2011 4:19 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
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) )
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
5 Apr 2011 11:12 PM #3
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
-
Where is the Ext.Direct specification page?
By pjs in forum Ext.DirectReplies: 0Last Post: 4 Feb 2011, 6:30 AM


Reply With Quote