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

[DataGridPro] Fix pagination state not updating if the data source response has no rows #15622

Merged
merged 1 commit into from
Nov 28, 2024

Conversation

zinoroman
Copy link
Contributor

This PR resolves an issue where the pagination displays an incorrect number of rows when fetching data from an API using the unstable_dataSource prop.

Reproduction:

  1. Visit Server side data docs, with data source section
  2. Apply a filter that matches no items (for instance, quantity = 9999)

Actual behavior:

  1. The displayed rows counter shows 100 items
  2. You can navigate between pages

image

This contrasts with client-side pagination, where the counter shows “0–0 of 0” when no results are found after applying a filter.

Expected behavior:

The rows counter should reflect the actual number of available rows, showing “0–0 of 0” when no data matches the applied filter, consistent with client-side pagination.

image

@zinoroman zinoroman changed the title [DataGridPro] DataGridPro] Fix pagination issue with rowCount: 0 in unstable_dataSource [DataGridPro] Fix pagination issue with rowCount: 0 in unstable_dataSource Nov 26, 2024
@mui-bot
Copy link

mui-bot commented Nov 26, 2024

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

Generated by 🚫 dangerJS against fc1885e

@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Nov 27, 2024
@arminmeh arminmeh added bug 🐛 Something doesn't work feature: Server integration Better integration with backends, e.g. data source labels Nov 27, 2024
@arminmeh arminmeh changed the title [DataGridPro] Fix pagination issue with rowCount: 0 in unstable_dataSource [DataGridPro] Pagination state not updated if data source response has rowCount=0 Nov 27, 2024
@arminmeh arminmeh changed the title [DataGridPro] Pagination state not updated if data source response has rowCount=0 [DataGridPro] Fix pagination state not updating if the data source response has no rows Nov 27, 2024
@arminmeh arminmeh added needs cherry-pick The PR should be cherry-picked to master after merge v7.x labels Nov 27, 2024
@arminmeh
Copy link
Contributor

@zinoroman thank you for the contribution

@arminmeh arminmeh merged commit a844e60 into mui:master Nov 28, 2024
27 of 28 checks passed
Copy link

Cherry-pick PRs will be created targeting branches: v7.x

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 needs cherry-pick The PR should be cherry-picked to master after merge v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants