Skip to content
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

Merged
merged 8 commits into from
Apr 1, 2025

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Mar 5, 2025

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:

  • The data was not cached.
  • The cache had expired.

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

  • Add skeleton rows for off-viewport rows

Follow-up

  • Add dynamic data demo

@MBilalShafi MBilalShafi added component: data grid This is the name of the generic UI component, not the React module! feature: Server integration Better integration with backends, e.g. data source labels Mar 5, 2025
@mui-bot
Copy link

mui-bot commented Mar 5, 2025

Deploy preview: https://deploy-preview-16827--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against de3e5f1

@MBilalShafi MBilalShafi changed the title [DataGrid] Exploration: always refetch lazy-loading rows [DataGrid] Always refetch lazy-loading rows Mar 21, 2025
@MBilalShafi MBilalShafi force-pushed the lazy-loading-cache-update branch from 27e73db to f96e707 Compare March 23, 2025 00:51
@MBilalShafi MBilalShafi marked this pull request as ready for review March 24, 2025 20:32
@MBilalShafi MBilalShafi requested a review from arminmeh March 24, 2025 20:32
@cherniavskii cherniavskii self-requested a review March 25, 2025 13:49
@MBilalShafi MBilalShafi added the bug 🐛 Something doesn't work label Mar 25, 2025
@cherniavskii cherniavskii added this to the 8.0.0 milestone Mar 25, 2025
Copy link

Thanks for adding a type label to the PR! 👍

@arminmeh
Copy link
Contributor

https://deploy-preview-16827--material-ui-x.netlify.app/x/react-data-grid/server-side-data/lazy-loading/#updating-the-loading-mode

If you load additional pages and start switching row count demo will have a runtime error
(if you can't reproduce I can make a video)

@MBilalShafi MBilalShafi requested a review from arminmeh March 27, 2025 09:30
@MBilalShafi MBilalShafi merged commit 72cc632 into mui:master Apr 1, 2025
21 checks passed
@MBilalShafi MBilalShafi deleted the lazy-loading-cache-update branch April 1, 2025 07:03
arminmeh pushed a commit to arminmeh/mui-x that referenced this pull request Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Server integration Better integration with backends, e.g. data source
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants