Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Extjs - Get rowIndex of a selected row

I have been seleted a row, and now i want get rowIndex

maybe like

grid.getSelectionModel().getSelection()[0].rowIndex

but it's undefined. How can i get it thanks

like image 433
DeLe Avatar asked Jun 24 '13 01:06

DeLe


1 Answers

how about this?

var selectedRecord = grid.getSelectionModel().getSelection()[0];
var row = grid.store.indexOf(selectedRecord);

you have to get the selected record of your grid and from that, you can search this record from your store and get its index.

like image 151
vvens Avatar answered Oct 21 '22 12:10

vvens