4

Is there a way to get the index of a row (row-index in the visible grid) by it's ID, which will also work with a sorted/grouped grid?

I am trying to use the function scrollRowIntoView from Slickgrid, which requires the index of the row. Now my problem is that I know the ID of the row, but not which index the row has in the grid. I also use groups which means I cannot search for the row-index in the data.

Preli
  • 2,953
  • 10
  • 37
  • 50

1 Answers1

13

You can use dataView.getRowById() to get the index of a filtered grid or you can use dataView.getIdxById() to get the index of the ID from the entire set of data.

idbehold
  • 16,833
  • 5
  • 47
  • 74
  • getRowById is exactly what I was looking for. Thank you so much – Preli Mar 27 '13 at 14:51
  • Doesn't work for me, for example i have 26 items in my grid in pages of 25 per page. I go to page 2 and the index should read 0 but it returns 26 – ladieu May 20 '13 at 20:07
  • Are you using `getRowById` or `getIdxById`? Do they return different values for you? – idbehold May 21 '13 at 00:55