[MUI Data Grid Pro] Tree collapses all groups when the rows are updated via props #9101
Open
2 tasks done
Labels
component: data grid
This is the name of the generic UI component, not the React module!
docs
Improvements or additions to the documentation
plan: Pro
Impact at least one Pro user
Duplicates
Latest version
Steps to reproduce 🕹
After migrating MUI-X from 5 to 6 the Data Grid (with TreeData) collapses all groups when the rows are updated via props.
In MUI-X 5.17.26 the problem does not occur.
Before (MUI-X 5.17.26)
After (MUI-X 6.5.0)
Current behavior 😯
If the records of a Data Grid (with TreeData) are updated via the prop rows, then all groups are collapsed.
Expected behavior 🤔
The state if a row is collapsed or expanded should be kept. The documentation says: "The simplest way to update the rows is to provide the new rows using the rows prop. It replaces the previous values." (https://mui.com/x/react-data-grid/row-updates/).
Context 🔦
After saving the changes, the new records are returned from the server. The records are then passed to the DataGrid via the prop rows. This will then collapse all currently expanded groups.
Your environment 🌎
I use the chrome browser version (113.0.5672.127)
npx @mui/envinfo
Order ID or Support key 💳 (optional)
57572
The text was updated successfully, but these errors were encountered: