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/
4.12k stars 1.28k forks source link

[data grid] Pinned rows not part of aggregation #13733

Open lauri865 opened 3 months ago

lauri865 commented 3 months ago

Steps to reproduce

Link to live example: https://stackblitz.com/edit/react-k2eej8?file=Demo.tsx

Steps:

  1. Use the default aggregation example: https://mui.com/x/react-data-grid/aggregation/
  2. Sum of gross is: $50,212,864,155 3.Pin last row
  3. Sum of gross is: $49,145,894,452

Current behavior

Pinned rows are not counted towards aggregations

Expected behavior

Pinned rows are counted towards aggregations as they are visible in the same flow and above totals rows

Context

No response

Your environment

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

Search keywords: pinned row aggregation

KenanYusuf commented 3 months ago

@lauri865 This does feel like a bug rather than expected behaviour. I will add it to the project board for prioritisation.

lauri865 commented 3 months ago

@KenanYusuf, I guess there are valid use cases for either way (e.g. adding custom subtotal rows that should not count towards totals), so probably should be toggleable behaviour.