WarUI

Tree aggregation

GRID-A17-F09P1baselinePlanned

Computes aggregate values such as sum, average, min, max, count or a custom function for parent rows from their descendants. Values recompute when data is edited or filtered. Aggregates can be shown in the parent row and in an optional grand-total footer.

Planned. This page shows the specification from issue #197. The live example, source for every framework and the API reference replace it when the feature ships.

Live example

A department budget tree with a Cost column summed and a Headcount column counted. Cells are editable.

Expected behavior

Parent cells display aggregates. Editing a leaf updates all of its ancestors and the grand total. Toggling aggregateOnlyFiltered changes the totals as rows are filtered.

Planned API surface

aggFunc (per column)customAggFuncsaggregateOnlyFilteredaggregateLeavesOnlyshowGrandTotalonAggregationChangedvalueFormatter

Acceptance criteria

  • A parent's sum equals the sum of its leaf values (aggregateLeavesOnly) or of its direct children's values (pending)
  • avg is computed from the underlying values, not by averaging child averages (pending)
  • Recalculation after an edit updates only the affected ancestor chain (pending)
  • A custom aggregate receives the child values and rows (pending)
  • Aggregated cells are read-only unless a custom setter is configured (pending)