I am using ExtJs6
I have a grid and a checkbox column as first column of the grid.
{ header: 'Select rows', dataIndex: 'selectedrows', xtype: 'checkcolumn' }
...
....
....
some more columns
.....
The rows can be selected by checking the chackboxes which is working fine. Now my requirement is - User can check as many rows as he wants, but I want only last checked row. For example, if user checked rows in following order row3 row2 row4 row1
Then I want row1 records as this is the last row checked by user.
To start this I tried getting grid selection as follows-
var selModel = grid.getSelectionModel();
var lngth = selModel.getSelection().length;
But here I am surprised to see the value of lngth is 0 even if I have selected 4 rows. Any idea what I am doing wrong here and how can I get last seleted row's record.