Topic: Datatables scroll to top when clicking pagination
BWBama85 free asked 5 years ago
On this page I'd like to scroll to the top when you click each of the pagination links https://www.bamapolitics.com/alabama/alabama-government-officials/profiles/
None of the stackoverflow or Google results have been working for me.
Bartłomiej Malanowski staff answered 5 years ago
Have you tried this? This seems to work fine
BWBama85 free commented 5 years ago
I had not. Thanks, it worked perfectly.
Shubham mt free commented 4 years ago
I have to use this same in angular 9 is there any possible solution for this.
Thanks
Arkadiusz Idzikowski staff commented 4 years ago
@Shubham mt if you use our table pagination component, you can listen to click events, for example: (nextPageClick)
or (previousPageClick)
.
Further implementation should be similar to the one from the jQ version. You need to find the offsetTop
of the table element, and use window.scrollTo(0, tableOffsetTop)
to scroll to the top of the table.
In case of any further problems, please create a new thread in Angular section and provide an example code.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Resolved
- ForumUser: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.7.3
- Device: Desktop
- Browser: Chrome
- OS: Windows 10
- Provided sample code: No
- Provided link: Yes