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] Tree Data doesn't work with checkboxSelection or rowReordering #5224

Closed
2 tasks done
teenguyen opened this issue Jun 16, 2022 · 2 comments
Closed
2 tasks done
Labels
component: data grid This is the name of the generic UI component, not the React module! support: commercial Support request from paid users

Comments

@teenguyen
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Current behavior 😯

I'm not sure if this is a bug or a feature request, but it looks like some of the DataGrid functionality doesn't work with some others; e.g. tree data with checkboxSelection or rowReordering

Expected behavior 🤔

I expect checkboxSelection to also check child rows.
I expect rowReordering to be able to work with tree data rows and correctly nest them in the right layer.

Steps to reproduce 🕹

I duplicated the tree data example and added the two props to test them out:
https://codesandbox.io/s/treedatafullexample-material-demo-forked-izdzo5?file=/demo.js

It looks like the checkbox doesn't check the nested child rows, and row reordering does not work at all.

Context 🔦

No response

Your environment 🌎

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

Order ID 💳 (optional)

LiveRamp

@teenguyen teenguyen added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jun 16, 2022
@flaviendelangle
Copy link
Member

flaviendelangle commented Jun 16, 2022

I expect rowReordering to be able to work with tree data rows and correctly nest them in the right layer.

image

You have a warning in the doc saying that for now it's not compatible
We will work on it at some point. It would require updating the row model after reordering to update its path.

It looks like the checkbox doesn't check the nested child rows

There is indeed no notion of parent-child relation-ship during selection.
You can implement one on your side see #4248.
We will probably add a prop to enable automatic children selection at some point

@flaviendelangle flaviendelangle added component: data grid This is the name of the generic UI component, not the React module! support: commercial Support request from paid users and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jun 16, 2022
@flaviendelangle
Copy link
Member

I am closing this one since both topics have a dedicated issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! support: commercial Support request from paid users
Projects
None yet
Development

No branches or pull requests

2 participants