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

[data grid] checkboxSelectionVisibleOnly with server-side pagination doesn't select all items on the second page #14070

Closed
1 task done
Londeren opened this issue Aug 1, 2024 · 3 comments · Fixed by #14083
Assignees
Labels
bug 🐛 Something doesn't work 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 feature: Server integration Better integration with backends, e.g. data source support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@Londeren
Copy link

Londeren commented Aug 1, 2024

Latest version

  • I have tested the latest version

Steps to reproduce

Link to live example: https://stackblitz.com/edit/react-f1gyh1?file=Demo.tsx

<DataGridPro
  columns={columns}
  unstable_dataSource={dataSource}
  pagination
  initialState={initialStateWithPagination}
  pageSizeOptions={[10, 20, 50]}
  checkboxSelection
  checkboxSelectionVisibleOnly
/>

Steps:

  1. Select all items by clicking on the main (Select All) checkbox in the header
  2. Navigate to page 2 and click the same Select All checkbox

Current behavior

Only 1 item is selected on the second page.

Expected behavior

All items are selected on the second page.

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: checkboxSelectionVisibleOnly, pagination, checkboxSelection
Order ID: 87418

@Londeren Londeren added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 1, 2024
@github-actions github-actions bot added component: data grid This is the name of the generic UI component, not the React module! support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ labels Aug 1, 2024
@michelengelen michelengelen changed the title DataGrid checkboxSelectionVisibleOnly with server-side pagination doesn't select all items on the second page [data grid] checkboxSelectionVisibleOnly with server-side pagination doesn't select all items on the second page Aug 2, 2024
@michelengelen
Copy link
Member

Hey @Londeren
I did assign this to @MBilalShafi who is our mastermind regarding the server-side integration! 👍🏼

@MBilalShafi MBilalShafi added feature: Server integration Better integration with backends, e.g. data source and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 3, 2024
@MBilalShafi
Copy link
Member

MBilalShafi commented Aug 3, 2024

Thank you @Londeren for reporting. I can reproduce this with the data source variant that you posted as well as the regular server-side pagination.

The culprit is the gridPaginatedVisibleSortedGridRowIdsSelector as it doesn't provide the correct sliced values when checkboxSelectionVisibleOnly prop is passed on a server-side paginated Data Grid.

I'll push a fix soon.

Copy link

github-actions bot commented Aug 7, 2024

⚠️ This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

@Londeren: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

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: Pagination Related to the data grid Pagination feature feature: Server integration Better integration with backends, e.g. data source support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants