View Full Version : How do I get column name from rowselection in an ExtJS grid?

19 Aug 2009, 12:05 PM
I have a extjs gridpanel setup, and I want to be able to do things based on a user clicking on text or icons in the grid. For example, filter the grid if the user clicks (or double clicks) a word in a column, or show a popup if the user clicks on an icon. I can easily get the row they clicked on, and values by column name from that row, but I don't know which column was clicked.

Alternatively, I could add an onClick to the entire grid, which I could then get the individual text from the row/column, but I don't know what row index or column that value belongs to. I could add a CSS class that would tell me a column name, but that seems like a hack.

Is there anything built-in that can do this?

19 Aug 2009, 12:23 PM
Might be worth looking at :


20 Aug 2009, 11:41 AM
I discovered the following on Saki's site :

Might cover what you are looking for...

20 Aug 2009, 11:51 AM
g.on('cellclick', function(grid, rowIndex, columnIndex, e) {
//Do what ever

g.on('cellcontextmenu', function(grid, rowIndex, columnIndex, e) {
//Do what ever