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] Deprecate pagination page count selector #8523

Closed

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Apr 6, 2023

Fixes #8450

Changelog

The gridPageCountSelector was deprecated. It may provide an incorrect value when used with the rowCount prop. Use specific selectors and props instead:

-const pageCount = useGridSelector(apiRef, gridPageCountSelector);
+const pageSize = useGridSelector(apiRef, gridPageSizeSelector);
+const visibleTopLevelRowCount = useGridSelector(apiRef, gridFilteredTopLevelRowCountSelector);
+const rowCount = rootProps.rowCount ?? visibleTopLevelRowCount;
+const pageCount = getPageCount(rowCount, pageSize);

@MBilalShafi MBilalShafi added component: data grid This is the name of the generic UI component, not the React module! feature: Pagination Related to the data grid Pagination feature deprecation New deprecation message labels Apr 6, 2023
@MBilalShafi MBilalShafi changed the title [DataGrid] Deprecate Grid pagination page count selector [DataGrid] Deprecate pagination page count selector Apr 6, 2023
@mui-bot
Copy link

mui-bot commented Apr 6, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-8523--material-ui-x.netlify.app/

Updated pages

No updates.

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 693 1,337.5 723.4 919.36 230.571
Sort 100k rows ms 650.6 1,213.3 1,199 1,068.76 212.221
Select 100k rows ms 229.2 328 299.6 291.74 33.822
Deselect 100k rows ms 187.4 296.7 269.5 248.2 47.675

Generated by 🚫 dangerJS against 4316668

@MBilalShafi MBilalShafi closed this Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! deprecation New deprecation message feature: Pagination Related to the data grid Pagination feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] Fix gridPageCountSelector selector
2 participants