This sample demonstrates the aggregate functionality of the Grid. In this sample, the aggregate values for the columns are displayed in the column footer.
The Grid supports displaying aggregates in its footer, group footer and group caption.
The aggregate configurations can be provided by the
aggregates
property.
Built-in aggregates:
SumAverageMinMaxCountTrueCountFalseCountCustom - Requires the
customAggregate
property to perform aggregation.
The custom aggregate value can be accessed inside template using the key custom.
In this demo, the
footerTemplate property is used to display four different aggregates (Sum, Average, Max and Min) in the Grid footer.
Each aggregate type is specified using the
type and
field properties accessed in the footerTemplate with its type name.
The aggregate value will be formatted based on its
format value (N2 or C2) before being displayed.
Injecting Module:
Grid component features are segregated into individual feature-wise modules. To use aggregate feature, we need to inject
Aggregate into the provide section.
More information on the Stacked Header feature configuration can be found in this documentation section.