In a pageable grid, I want to move to the page that contains the row for uid == x. But how can I determine the page number for the data item with uid == x, if a sort or filter has been applied to the grid? If there is no sort or filter, I can find the page number with the following code:
But that code is not correct if the grid is sorted and/or filtered.
What is the correct code?
function gotoPageForUid (grid, uid) { var kdata = grid.dataSource.data(); for (var i = 0; i < kdata.length; i++) { if (uid == kdata[i].uid) { var pgsize = grid.dataSource.pageSize(); var pageForRow = 1 + Math.floor(i/pgsize);
grid.dataSource.page(pageForRow); break; } }}But that code is not correct if the grid is sorted and/or filtered.
What is the correct code?