View Full Version : How to get the ROW from gridpanel?

29 May 2013, 2:06 AM
Below line is not working to select row from gridPanel.

var rowToHighlight=Ext.get(grid.view.getRow(rowIndex));

29 May 2013, 2:43 AM
what exactly do you want to do? The selection model might help you:


E.g. if you want to get the selected row(s):

var sRows = grid.getSelectionModel().getSelection();

or if you want to set the selection programmatically:

var index = 0;
grid.getSelectionModel().select(index); // select record by index

var record = grid.getStore().first();
grid.getSelectionModel().select(record); // select record

29 May 2013, 2:54 AM
I use both the code line but result is UnDefined. :s

29 May 2013, 3:00 AM
what is undefined? do you have the grid visible in this scope? if you are using an id in your grid, then you can try Ext.getCmp('gridID').getSelectionModel()....