DataTable auto scroll down to last row
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 2
- Joined: 08 Mar 2023, 14:15
I have a DataTable element with options: scrollable scrollHeight='70vh' rowGroupMode="subheader". So the header and subheaders ar frozen when scrolling table and there is a scroller inside the DataTable element itself. I am trying to make it auto scroll to last row on render or state update, I can make the page itself to scroll down, but the issue is that DataTable element has its own scroller and im not sure how to access it. Is there a way to do it?
-
- Posts: 2
- Joined: 08 Mar 2023, 14:15
Replaying to myself:
document.documentElement.getElementsByClassName('p-datatable-wrapper')[0].scrollTo({
top: 3000,
behavior: 'smooth',
});
document.documentElement.getElementsByClassName('p-datatable-wrapper')[0].scrollTo({
top: 3000,
behavior: 'smooth',
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 1 guest