Presenting a limited number of rows on a grid at a time

1 Answer 40 Views
Grid
George
Top achievements
Rank 2
Iron
Iron
Iron
George asked on 13 Dec 2023, 03:58 PM

Hi,

Have a question regarding pagination or adding records as I need them to a Kendo UI grid. I am not even sure how to express or ask this question.
Want to add records as I scroll down/up on a grid, and remove the ones not visible in the grid. Ultimately, I only want to show a portion of the records the API can grab from the database.

The idea is I might pull in 1,000 +  records and only want to show like 20 on the screen, the ones not visible are NOT in the client on the browser. One of my coworkers mentioned I could do this with "Pagination". Where you would dynamically call the API for more records as you scrolled down (or up) to add the non-visible records. How do you do this with a Kendo Grid?

Would I need to request records 1-20, then when I move down it loads 20-40, and when 20 is at the top it only refreshes 20-40;  discarding 1-19? How does that work? Is there a mechanism that handles this?

Do I have to coordinate this with the API some how so I only get records 1-N, do I have to specify this somehow with the API?


•If the original 20 leave the uper edge of the grid -> then unload them.
•If I scroll down past 20 --> load 20 more
• If I scroll up --> load the previous 20.

How would I achieve this?

Thanks!

George

1 Answer, 1 is accepted

Sort by
0
Martin
Telerik team
answered on 18 Dec 2023, 09:44 AM

Hello, George,

If I correctly understand the requirement, please refer to the Virtual Scrolling or the Endless Scrolling features. Both of them allow you to display portions of the Grid data so that you don't hit performance issues. The only difference compared to what you described is that the loaded rows cannot be unloaded - once rendered, they will remain in the Grid, but will not cause performance issues. 

Let me know if the above information is what you are looking, or if I misunderstood the requirement.

Regards,
Martin
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources
George
Top achievements
Rank 2
Iron
Iron
Iron
commented on 28 Dec 2023, 07:04 PM

this looks like the best we can do. Hopefully I won't get an incoming response with a huge amount of records for the grid. But thank you!

-George
Tags
Grid
Asked by
George
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Martin
Telerik team
Share this question
or