PDA

View Full Version : How to identify current position in Edit-Grid



ust
23 Apr 2010, 3:07 PM
Hi,

I am working on the edit-grid.html (http://www.extjs.com/deploy/dev/examples/grid/edit-grid.html). Is it possible to know the current location of the cell that is highlighted?

To give some more details, I click on any cell and am not in edit mode (press ESC if in edit mode. I cannot make entry in the cell). I press arrow keys or tab keys to navigate in the grid. Is there a way to know at any point which cell is currently highlighted? I need to know this on keydown event of the grid.



grid.on('keydown', handleKeyDown);
function handleKeyDown(e) {
// currentRow = ?
// currentCol = ?
}
Please help.

Thanks in advance.

darthwes
23 Apr 2010, 4:54 PM
var curr = grid.getSelectionModel().getSelections(); //or getSelection()

ust
24 Apr 2010, 7:35 PM
Hi darthwes,

Thanks a lot for your help. I had to make a small change to it for my code, but then worked like a charm!

Change I made:
curr = grid.getSelectionModel().getSelectedCell();

Thank you.