infinite-table / infinite-react

The modern React DataGrid for building apps — faster
https://infinite-table.com
73 stars 5 forks source link

Pivot Total Column is not displayed when only one pivot column #22

Open vitolpoc opened 2 years ago

vitolpoc commented 2 years ago

When configuring only one pivot and the pivotTotalColumnPosition, the total column is not displayed.

sandbox: https://codesandbox.io/s/infinite-table-pivot-total-column-for-one-level-m3ioz?file=/src/App.tsx

Version: 0.0.8 Actual Result: Total column is not displayed Expected Result: Total column should be displayed if configured with "start" or "end" value

roblotter commented 2 years ago

This was intentionally implemented like this, as there are no column groups and only one pivot available.

Screenshot 2022-01-03 at 12 13 14

We can revisit this if you think it would be useful to allow a totals column in this case - our initial thinking was that you don't have column groups generated, so no need for a totals column to aggregate the column group.

vitolpoc commented 2 years ago

In the screenshot above, we cannot have the aggregation (let's say the average) for the whole TypeScript row then.

The fact that the column represents a pivot means it's a group of values, so it makes sense to be able to configure the whole aggregation for this group like if it was in another column group IMO.

roblotter commented 2 years ago

So basically you want a grand total column, correct?

Something like Screenshot 2022-01-06 at 13 36 51 (source)

(ignore for now the "Grand Total" row - that will probably also come in the future)

What's nice would also be the ability to have multiple aggregations - I think this is what you mean by #19 , am I right?

Let us know if our assumptions are correct, so we can start on the implementation

vitolpoc commented 2 years ago

yes your assumptions are correct. Like we could have a total row, we could have a total column (when using pivot).

Indeed #19 refers to multiple aggregations.