PrimeNG Table with Virtual Scroll & Large Dataset Sorting #3485
Unanswered
TheCloudGate
asked this question in
PrimeNG
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm working with a PrimeNG Table component displaying a large dataset (10,000 elements). I've implemented virtual scrolling with a page size of 1000 elements, allowing for efficient rendering and smooth scrolling.
Goal:
When the user clicks to sort by a column (initiating a new sort order), I want to:
Efficiently refresh the displayed data with the new sort order.
Avoid unnecessary data downloads if the entire dataset (10,000 elements) is already in the local cache due to previous paging operations.
Current Approach & Challenges:
My current approach likely involves refetching data from the server on every sort. This is inefficient when the entire dataset is already available locally.
Questions:
How can I optimize the sorting logic to leverage the locally cached data when possible?
Are there any built-in PrimeNG features or best practices for handling sorting within a virtual scroll scenario with large datasets?
Should I implement a custom sorting mechanism that prioritizes the local cache and only fetches new data when necessary?
Beta Was this translation helpful? Give feedback.
All reactions