Is it possible to group rows by column groups?
Say you have a column group which contains two columns: 'firstName' and 'lastName'. When you group the rows by the column group (i.e. by the combination of firstName and lastName), the default behaviour is a single grouping row for the column group, which cannot be expanded (https://tanstack.com/table/v8/docs/examples/react/grouping).
Intuitively I would expect to get multiple grouping rows at depth 0, one for each unique combination of values for the leaf columns from that column group. That is, one row grouping all the John Smiths, another grouping all the Jane Does and so on. Is there any builtin way to achieve this behaviour?
It's possible to achieve a similar logical behaviour by grouping each of the leaf columns from the column group sequentially, (instead of the grouping column itself), but that can result in a deeply nested row structure which is quite unpleasant to work with from a UX perspective. In my use case, column groups can have up to 5 or so leaf columns. My current thinking is to take this approach, and wrap the grouped row model to flatten the relevant depths retrospectively.
0 Replies