DataTable auto scroll down to last row

Forum rules
Please note that response time for technical support is within 3-5 business days.
Post Reply
janisusans1
Posts: 2
Joined: 08 Mar 2023, 14:15

26 Apr 2023, 10:45

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?

janisusans1
Posts: 2
Joined: 08 Mar 2023, 14:15

27 Apr 2023, 22:54

Replaying to myself:

document.documentElement.getElementsByClassName('p-datatable-wrapper')[0].scrollTo({
top: 3000,
behavior: 'smooth',
});

Post Reply

Return to “Roma - PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests