Currently, we can change the displayed record using the dataSource page method:
However, sometime we may want to display records based on the index instead of the page number. Ex: I'm currently trying to create a workaround to select a specific row using an index value when the virtual scrolling is enable (this feature isn't supported by Kendo yet). I'm almost done but the only thing missing to complete this workaround is a way load records based on their index.
After taking a look at the grid behavior, I came to the conclusion there's probably an internal function in the grid that would allow us to do such task. Indeed, when you scroll using the virtual scrollbar, the grid's tbody rows that gets loaded are often independent from the page.
Ex: If your dataSource has a pageSize of 100, you would expect the grid to load index 0 to 99 / 100 to 199 / 200 to 299... however, when you look at rows inside the tbody, you'll find out that the displayed rows are not directly linked to the current page so you may end with 100 rows starting from index 96 to 195.
Is there a way to invoke or trigger the function that would change the displayed record based on an index range, like the grid does internally?
Best regards,
Simon
N.B. When the grid send the OData request to the servers it still follows the expected index sequence based on a requested page number... however, bringing record 100 to 199 from the server doesn't mean they will be the one displayed in the tbody.
kendoGrid.dataSource.page(1);However, sometime we may want to display records based on the index instead of the page number. Ex: I'm currently trying to create a workaround to select a specific row using an index value when the virtual scrolling is enable (this feature isn't supported by Kendo yet). I'm almost done but the only thing missing to complete this workaround is a way load records based on their index.
After taking a look at the grid behavior, I came to the conclusion there's probably an internal function in the grid that would allow us to do such task. Indeed, when you scroll using the virtual scrollbar, the grid's tbody rows that gets loaded are often independent from the page.
Ex: If your dataSource has a pageSize of 100, you would expect the grid to load index 0 to 99 / 100 to 199 / 200 to 299... however, when you look at rows inside the tbody, you'll find out that the displayed rows are not directly linked to the current page so you may end with 100 rows starting from index 96 to 195.
Is there a way to invoke or trigger the function that would change the displayed record based on an index range, like the grid does internally?
Best regards,
Simon
N.B. When the grid send the OData request to the servers it still follows the expected index sequence based on a requested page number... however, bringing record 100 to 199 from the server doesn't mean they will be the one displayed in the tbody.