mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
3.91k stars 1.19k forks source link

[data grid] Expanding empty groups #13204

Open RomanMain opened 1 month ago

RomanMain commented 1 month ago

The problem in depth

When grouping a column with a null or undefined value, is it possible to create a unique grouping key for such values ​​so that they can be expanded in the same way as other groups?

https://mui.com/x/react-data-grid/row-grouping/#rows-with-missing-groups. It is described here that by default the table will use inline for such values, but perhaps there is some workaround ?

Screenshot_4

Your environment

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

Search keywords: grouping, expand Order ID: 82865

flaviendelangle commented 1 month ago

Hi,

You can use the groupingValueGetter prop to return a key ("NO_VALUE" for example)

It would probably be worth adding a doc example (cc @michelengelen)

michelengelen commented 1 month ago

It would probably be worth adding a doc example (cc @michelengelen)

Absolutely! I will add this to the umbrella issue! Thanks for the ping @flaviendelangle! 🙇🏼

cherniavskii commented 1 week ago

@RomanMain Here's a working demo: https://codesandbox.io/p/sandbox/flamboyant-gates-y7yy2y?file=%2Fsrc%2FDemo.tsx%3A15%2C44