PDA

View Full Version : [CLOSED] How to get selected row index on row selection in client side?



speedstepmem4
Nov 13, 2013, 10:53 AM
Hi,

Please provide us a solution for getting selected row Index on RowSelection event in client side...

Daniil
Nov 13, 2013, 12:26 PM
Hi @speedstepmem4,

An index of selected record is passed to a RowSelectionModel's Select listener as the "index" argument.
http://docs.sencha.com/extjs/4.2.0/#!/api/Ext.selection.RowModel-event-select

speedstepmem4
Nov 14, 2013, 4:00 AM
Hi Daniil,

Thanks for the reply!!

Actually We are using Ajax Proxy to fill the grid. So the first row of the second page also shows row index as 0 which is not correct.
Actually it should be 16, since we are showing 15 records in the first page!

Daniil
Nov 14, 2013, 4:07 AM
When you use remote paging, only the current page is presented in the GridPanel. So, it is actually the first row (with 0 index).

To get an index of total, please try:

this.store.indexOfTotal(record)
inside a Select listener.

speedstepmem4
Nov 14, 2013, 5:22 AM
Hi Daniil,

Now it's working fine. You mark this issue as closed.