-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Steps to reproduce
Steps:
- Open this link to live example: live demo
- Group by the dateCreated column.
- Then group by the company column.
- Expand any grouped row.
Current behavior
App crashes with the following error:
MUI X:
datecolumn type only accepts
Dateobjects as values. Use
valueGetterto transform the value into a
Date object. Row ID: auto-generated-row-dateCreated/Wed Jan 12 2022 18:36:23 GMT+0200 (Eastern European Standard Time)-company/20th Century Fox, field: "dateCreated".
Expected behavior
Grouped rows expand normally.
Context
I'm building a data grid that groups rows by multiple columns, including a date field. The date field is stored as an ISO string in the dataset and is converted to a Date object using a valueGetter, as recommended for type: "date" columns. However, when grouping by this date column, the grid crashes due to the grouping logic not respecting the valueGetter result. I'm trying to implement hierarchical grouping (e.g., Date → Company) without needing to mutate the original data or duplicate values.
Your environment
npx @mui/envinfo
Reproduced in CodeSandbox: https://codesandbox.io/p/sandbox/z24lgh
Environment Info:
- OS: CodeSandbox (cloud)
- Browser: Tested in Chrome 137
- @mui/material: 7.1.2
- @mui/x-data-grid-premium: 8.5.3
- react: 18.2.0
Search keywords: DataGridPremium, rowGrouping, group by date, valueGetter, type: date, Date object error, MUI X, column grouping, crash on expand, auto-generated-row
Order ID: 96739