New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[data grid] When using Datagrid's aggregation is it possible to somehow use group row's value instead of the aggregated one? #13027
Comments
Hey @gulicJan |
Please, that would be very useful. If that's not possible, we have another way of going around this by skipping some rows from the aggregation - is that possible? |
Got it. 👍🏼
Well, you can always build your custom aggregation functions where you could use some conditions to skip aggregation for rows. |
How can I skip the row from the aggregation for example when row.shouldSkip === true? I've found one way by using getCellValue like this:
but my problem with that is that im using this Sum aggregation function for multiple columns not only for |
It is not easy to build a general solution. That's true. |
That's true, but the "issue" is that the logic of skipping particular rows should be applied to every column and we have more than 40 of them. And also for later if we would add new columns in this case we would need also to create new aggregation functions for them. Any luck with the solution? |
Just picked it up again ... I had some meetings yesterday and could not finish it. I will try now to find a good solution for that. |
Hey @gulicJan ... I finished the exploration and it is possible to exclude grouping rows (parent rows) from aggregation and still generalize them. Here is an example. Would this be solution you can work with? |
The problem in depth
Hey,
is there any way how to avoid the mentioned logic? I'm using aggregation and in some cases I want the group row to skip aggregation and use it's value instead (aggregation was done on the server for some specific cases).
MUI Example:
https://stackblitz.com/run?file=Demo.tsx
How to achieve that the Public grouped row's value 1Kb would be considered as the row's value instead of the aggregated value of 40 Kb.
Your environment
`npx @mui/envinfo`
Search keywords: datagrid aggregation tree-data
Order ID: 64163
The text was updated successfully, but these errors were encountered: