ExtJS 4 - Grid Cell Events?

In ExtJS 3.x, the Grid Panel component had associated events for cells, including cellclick , cellcontextmenu , celldblclick and cellmousedown , and listeners on these events were passed as rowIndex and colIndex cell that triggered the event.

In 4.x, these events disappeared, there are only item * events (i.e. itemclick ), but these events light up for the grid lines as a whole and therefore are transmitted only by the row index.

Is there a way to determine which column was clicked using these events, or is there an alternative way to connect listeners to cells?

+8
javascript-events event-handling extjs grid extjs4
source share
2 answers

I think the key to your question lies in the chosen model of choice for the grid. By default, a row selector is used, so item selection events work on rows. Check out the cell selector API here: http://docs.sencha.com/ext-js/4-0/#!/api/Ext.selection.CellModel-event-select

+9
source share

(ExtJS 4.1)

You can also connect the (undocumented) uievent grid view:

 grid.getView().on( 'uievent', this.onUIEvent, this); onUIEvent: function ( aType, aView, aCell, aRecordIndex, aCellIndex, aEvent ) { console.log( aRecordIndex + ' : ' + aCellIndex ); }, 
+2
source share

All Articles