How to scroll to top of 'page' onPageChange in KendoGrid

1 Answer 839 Views
Grid
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Grant asked on 01 Oct 2021, 07:00 AM

Hi Team, 

Im using pagination in a KendoReact Grid, and when a user scrolls to the bottom of the 'page' and changes the page, the scrollbar stays at the bottom, it doesn't snap back to the top of the next page. How can I make this behavior work?

Demo:
See the Basic example on the Demo Page, It displays 10 items per page, but you have to scroll to see item 10, then if you change the page, the scroll bar doesn't snap to the top of the page, you have to scroll up manually to see item 11 (or whichever)

Thanks,
Grant

1 Answer, 1 is accepted

Sort by
1
Accepted
Stefan
Telerik team
answered on 01 Oct 2021, 07:43 AM

Hello, Grant,

In this case, we can suggest resetting the scroll position each time the page is changed.

I made an example showcasing how this can be done:

https://stackblitz.com/edit/react-dktmxn?file=app/main.jsx

Regards,
Stefan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Grant
Top achievements
Rank 3
Iron
Iron
Veteran
commented on 01 Oct 2021, 07:53 AM

Thanks Stefan, Im cautious about referencing DOM elements inside the Kendo components incase they change in a version update.

Stefan
Telerik team
commented on 01 Oct 2021, 09:05 AM

Hello, Grant,

The elements change very rarely and if they do this will be clearly described as a breaking change.

We know that developers use these elements classes for specific cases and for styling, this is why we are very careful about changing them.

Tags
Grid
Asked by
Grant
Top achievements
Rank 3
Iron
Iron
Veteran
Answers by
Stefan
Telerik team
Share this question
or