adazzle / react-data-grid

Feature-rich and customizable data grid React component
https://adazzle.github.io/react-data-grid/
Other
7.02k stars 2.19k forks source link

Select All/ Unselect All #3034

Open JayYoungman opened 2 years ago

JayYoungman commented 2 years ago

We have an issue on our application, where we import products, that show on the grid at a root level, but are also shown as nested child products. This has broken the select all, because these child products have the same row Id (which we generate from the product id) as the product at root level, select all and unselect all doesn't work correctly, as the selected length is greater than the total amount of products. For example. 25 products selected (actually 27 is selected due to 2 child products being selected). we can no longer unselect all, as that length is greater than the total.

To Reproduce

  1. Create 3 top level products in the grid. Prod1, Prod2, Prod3.
  2. Prod3 should be a parent, with Prod1 and Prod2 as children (while still keeping Prod1 and Prod2 in the root of grid).
  3. attempt to select and deselect all. (ensure the row keys are the same for the nested children).

Thanks :)

amanmahajan7 commented 1 week ago

Can you create a codesandbox example?