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] Limit to one expanded row group at a time #7782

Closed
2 tasks done
Tracked by #9328
swathign-sbdinc opened this issue Feb 1, 2023 · 11 comments · Fixed by #9488
Closed
2 tasks done
Tracked by #9328

[data grid] Limit to one expanded row group at a time #7782

swathign-sbdinc opened this issue Feb 1, 2023 · 11 comments · Fixed by #9488
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: logic Logic customizability docs Improvements or additions to the documentation feature: Master-detail Related to the data grid Master-detail feature recipe support: question Community support but can be turned into an improvement

Comments

@swathign-sbdinc
Copy link

swathign-sbdinc commented Feb 1, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Link to live example:

Steps:
1.
2.
3.

Current behavior 😯 It is expanding everything

No response

Expected behavior 🤔

I need to expand only one row at a time (if 1 row is expanding any other previously expanded row should auto collapse)

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)

No response

@swathign-sbdinc swathign-sbdinc added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Feb 1, 2023
@swathign-sbdinc swathign-sbdinc changed the title I need to expand only one row at a time (if 1 row is expanding any other previously expanded row should auto collapse) I need to expand only one row at a time (if 1 row is expanding any other previously expanded row should auto collapse) Feb 1, 2023
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Feb 1, 2023
@cherniavskii cherniavskii changed the title I need to expand only one row at a time (if 1 row is expanding any other previously expanded row should auto collapse) [data grid] Limit to one expanded row group at a time Feb 1, 2023
@cherniavskii
Copy link
Member

cherniavskii commented Feb 1, 2023

Hey @swathign-sbdinc
If the rows are grouped only by one column - then this should work:
https://codesandbox.io/s/kind-dewdney-mx5ivo?file=/demo.tsx

Is this what you're looking for?

It uses the rowExpansionChange event which is not documented publically yet (there's a separate issue for it: #6335)

@cherniavskii cherniavskii added support: question Community support but can be turned into an improvement feature: Row grouping Related to the data grid Row grouping feature customization: logic Logic customizability status: waiting for author Issue with insufficient information and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Feb 1, 2023
@swathign-sbdinc
Copy link
Author

swathign-sbdinc commented Feb 1, 2023 via email

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Feb 1, 2023
@cherniavskii
Copy link
Member

@swathign-sbdinc I assumed your question was about Row grouping feature, which is only available in the Premium plan.
If my assumption is correct, then it won't work for DataGrid Pro.

@cherniavskii cherniavskii added the status: waiting for author Issue with insufficient information label Feb 1, 2023
@swathign-sbdinc
Copy link
Author

swathign-sbdinc commented Feb 2, 2023 via email

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Feb 2, 2023
@cherniavskii
Copy link
Member

My question is using Data grid pro, when user expands one row

Are you referring to the Master detail feature?
Could you provide more details on your use case?

@cherniavskii cherniavskii added the status: waiting for author Issue with insufficient information label Feb 2, 2023
@swathign-sbdinc
Copy link
Author

swathign-sbdinc commented Feb 3, 2023 via email

@github-actions github-actions bot removed the status: waiting for author Issue with insufficient information label Feb 3, 2023
@swathign-sbdinc
Copy link
Author

swathign-sbdinc commented Feb 3, 2023 via email

@cherniavskii
Copy link
Member

Yes, I am using Data grid pro Master detail feature
My use case is restrict the use of expanding/opening more than one row.

Alright. For the Master detail you can control the expanded panels and limit to one opened panel at a time, see this demo: https://codesandbox.io/s/pedantic-field-xn5uk1?file=/demo.tsx

@cherniavskii cherniavskii added feature: Master-detail Related to the data grid Master-detail feature status: waiting for author Issue with insufficient information and removed feature: Row grouping Related to the data grid Row grouping feature labels Feb 3, 2023
@github-actions
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@cherniavskii cherniavskii moved this from 🆕 Needs refinement to 🔖 Ready in MUI X Data Grid Jun 20, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid Jun 20, 2023
@cherniavskii cherniavskii reopened this Jun 20, 2023
@github-project-automation github-project-automation bot moved this from 🔖 Ready to 📋 Backlog in MUI X Data Grid Jun 20, 2023
@cherniavskii cherniavskii added docs Improvements or additions to the documentation recipe labels Jun 20, 2023
@github-actions
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@github-actions
Copy link

Since the issue is missing key information and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.

@cherniavskii cherniavskii removed the status: waiting for author Issue with insufficient information label Jun 26, 2023
@cherniavskii cherniavskii reopened this Jun 26, 2023
@m4theushw m4theushw moved this from 📋 Backlog to ✅ Done in MUI X Data Grid Jul 11, 2023
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! customization: logic Logic customizability docs Improvements or additions to the documentation feature: Master-detail Related to the data grid Master-detail feature recipe support: question Community support but can be turned into an improvement
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants