shrin
shrin

Reputation: 11

How to do grouping in react-admin DataGrid

Is there a way to do grouping in react-admin DataGrid component? See example below

DataGrid with Grouping

Upvotes: 1

Views: 1408

Answers (2)

Roberto Rodriguez
Roberto Rodriguez

Reputation: 11

Another way of doing this is to create a specific query that returns the data already grouped, and then use the approach in the demo: https://marmelab.com/react-admin-demo/#/invoices to display the details of each grouped row in a custom component.

In my experience, when you don't have an army of developers it's always better to keep the tables/grids slim and solve problems creatively around them than to build a supercharged table that in the end will never solver every future use case. I guess react-tables and react-form new concepts are aligned with this "philosophy".

The next problem you'll find the datagrid grouping is how do you group paged data and how to do you explain those differences between full data set and paged data set groupings to the user.

Upvotes: 1

Ashim Saha
Ashim Saha

Reputation: 493

No, it is not possible. There is no core component to do that. But you can write your own component to achieve it.

Upvotes: 1

Related Questions