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] Make rowCount part of the state #12381

Merged
merged 16 commits into from
Mar 10, 2024

Conversation

MBilalShafi
Copy link
Member

@MBilalShafi MBilalShafi commented Mar 8, 2024

@MBilalShafi MBilalShafi added the component: data grid This is the name of the generic UI component, not the React module! label Mar 8, 2024
@mui-bot
Copy link

mui-bot commented Mar 8, 2024

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

Generated by 🚫 dangerJS against 9d9875a

@@ -32,4 +33,5 @@ export interface GridApiPro
export interface GridPrivateApiPro
extends GridApiPro,
GridPrivateOnlyApiCommon<GridApiPro, GridPrivateApiPro, DataGridProProcessedProps>,
GridDetailPanelPrivateApi {}
GridDetailPanelPrivateApi,
GridInfiniteLoaderPrivateApi {}
Copy link
Member Author

@MBilalShafi MBilalShafi Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why these changes were not detected in #8672 😕

@MBilalShafi MBilalShafi marked this pull request as ready for review March 8, 2024 15:42
@MBilalShafi MBilalShafi added needs cherry-pick The PR should be cherry-picked to master after merge bug 🐛 Something doesn't work labels Mar 8, 2024
@MBilalShafi MBilalShafi marked this pull request as draft March 8, 2024 15:59
Copy link
Member Author

@MBilalShafi MBilalShafi Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no reason not to port this to v6 since there's no breaking change now, please share if any objections

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with that. My PR was simpler but having both versions use the same code is better.

@MBilalShafi MBilalShafi marked this pull request as ready for review March 8, 2024 19:02
@MBilalShafi MBilalShafi changed the title [DataGrid] Make rowCount part of grid state [DataGrid] Make rowCount part of the state Mar 8, 2024
@@ -524,12 +524,13 @@ describe('<DataGrid /> - Pagination', () => {
});
});

it('should react to an update of rowCount', () => {
it('should react to an update of rowCount when `paginationMode = server`', () => {
Copy link
Member Author

@MBilalShafi MBilalShafi Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an updated behavior, now rowCount prop will only be synchronized when paginationMode is server since on client mode, internal computation makes more sense for rowCount calculation as rows are available. (I can't think of any legitimate use-cases affected from this change)
Any objections?

@MBilalShafi MBilalShafi merged commit 7c4ba74 into mui:next Mar 10, 2024
17 checks passed
@MBilalShafi MBilalShafi deleted the row-count-state branch March 10, 2024 06:51
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
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! needs cherry-pick The PR should be cherry-picked to master after merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DataGrid] Fix gridPageCountSelector selector
3 participants