-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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] Select All Functionality in Tree View #14100
Comments
Hey @mahammahmood ... there is an open PR currently in the works (#13757) that will include exactly the behavior you are expecting. Otherwise we already have a workaround for this here: #13391 (comment) |
Hey @michelengelen My functionality is different; I did not use the 'Select All' from DataGrid. Instead, I manually set the checkboxes in handleCheckboxChange() and used a separate button in the toolbar for selecting all checkboxes. Please guide me according to my code. |
Hi @mahammahmood To fix this, you will have to change the way you are updating all checkboxes after clicking on the Hope that this helps |
@mahammahmood: 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. |
can you provide any other solution. |
you would have to deal with the checkbox state change in your select all handler rather in the row itself. |
Yes, there is a reason I don't use row selection: the functionality I want cannot be achieved with it. In row selection, we are unable to select all the child nodes when a parent node is selected, and when not all the child nodes are selected, the parent node becomes indeterminate. |
Latest version
The problem in depth
When I click on 'Select All', all the checkboxes are checked. However, if I then uncheck any checkbox and expand any child, it becomes checked again because I use useEffect to update the row checkbox state when the state changes. Can you suggest a solution to achieve the expected behavior? Specifically, when I click 'Select All', it should select all checkboxes; if I unselect any checkbox individually, it should stay unselected; and if I click 'Unselect All', it should unselect all selected checkboxes.
Here is the live demo:
DEMO
Here is the video of the issue:
https://github.com/user-attachments/assets/c7a8a5e0-f8c9-42bd-8f1e-7877035d6a0f
Your environment
`npx @mui/envinfo`
Search keywords: Data ,Grid , Premium, Tree, data, Select, All
Order ID: 91010
The text was updated successfully, but these errors were encountered: