-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DataGrid] Always refetch lazy-loading rows #16827
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-16827--material-ui-x.netlify.app/ |
27e73db
to
f96e707
Compare
Thanks for adding a type label to the PR! 👍 |
If you load additional pages and start switching row count demo will have a runtime error |
*/ | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can see skeleton rows on fast scroll which degrades UX.
Is it possible to keep the rows and fetch new data to refresh them?
loading state can be delayed a bit so that it shows up if you are actually waiting for the request to be resolved?
This will open up more cases for duplicate row id, but we can always check for that before applying update
Compare experience after loading all rows and scrolling fast
https://next.mui.com/x/react-data-grid/server-side-data/lazy-loading/#infinite-loading
https://deploy-preview-16827--material-ui-x.netlify.app/x/react-data-grid/server-side-data/lazy-loading/#infinite-loading
Also, I think that https://next.mui.com/x/react-data-grid/server-side-data/lazy-loading/#request-throttling needs to be skipped for already loaded rows, so that cache can be loaded faster
Related to #16719 (comment)
Pre-requisite for #16045, should ensure proper data integrity after an edit operation has been done in a lazy-loaded Data Grid.
Update
Previously, lazy-loaded data was never re-fetched, even in cases where:
Now, lazy loading attempts to fetch fresh data when the viewport is scrolled. If the data is already cached and valid, it's retrieved from the almost instant cache. However, if the data is missing or the cache has expired, the fresh data will be retrieved.
Todos
Follow-up