-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[DataGrid] Set correct data source cache chunk size when pagination is disabled #18636
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
base: master
Are you sure you want to change the base?
Conversation
Deploy preview: https://deploy-preview-18636--material-ui-x.netlify.app/ Bundle size reportTotal Size Change: 🔺+1.16KB(+0.01%) - Total Gzip Change: 🔺+381B(+0.01%) Show details for 100 more bundles (22 more not shown)@mui/x-data-grid-premium parsed: 🔺+195B(+0.03%) gzip: 🔺+49B(+0.03%) |
Fixes #18611
If the user does not use pagination model in request params to generate the response, the grid will have the default pagination model in the state, but all the data will be retrieved in one request (pageSize = 100 -> 1000 rows retrieved).
Our chunk manager would create only one chunk, but it would slice the data as it would make 10.
The update makes the chunk manager take the whole data if there is only one chunk to be generated (covers the scenario from above)
Lazy loading is not affected, because you have to use start and end parameters, which are then correctly used by the chunk manager to prepare chunks upfront. I have added a test where we retrieve 3 pages at once and later ask for the first page only.