This is a migrated thread and some comments may be shown as answers.

[Solved] Change virtual scrolling records using an index range

1 Answer 176 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 05 Jan 2015, 08:59 PM
Currently, we can change the displayed record using the dataSource page method:

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.

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 07 Jan 2015, 02:45 PM
Hello Simon,

The behavior you described is not supported out of the box. You can however, achieve similar results using the workaround shown in this example.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or