How to determine the selected cell of a Ext.grid.Panel in ExtJS 4?
13,080
Solution 1
There may be a more direct way to do this but the following seems to work for me:
grid.view.getCellByPosition(grid.getSelectionModel().getCurrentPosition());
Solution 2
I ended up needing the actual column that the user was clicking on and discovered the following:
grid.panel.columns[grid.getSelectionModel().getCurrentPosition().column]
Don't forget to apply:
selType : 'cellmodel'
to your grid to make sure you can select cells!
Author by
Sebastian
Updated on June 28, 2022Comments
-
Sebastian almost 2 years
how can i get the selected cell of a Ext.grid.Panel? In ExtJS 3 it was possible via:
grid.getSelectionModel().getSelectedCell()
In Ext 4 there is
grid.getSelectionModel().selected
but this only gives me the record.
-
Sebastian almost 13 yearsI'm not at work anymore, so i can't try... What i did as a workaround, was to 'misuse' the select-event and store the cell and column in an own variable.
-
Craig almost 13 yearsYeah, that was my first thought too, until I read through the source code and came up with the above!