Example of Default Aggregate in Javascript Data Grid Control

/
/
Default Aggregate

This sample demonstrates aggregate functionality of the Grid. In this sample, the aggregate value for the column “Freight” is displayed in column footer.

More Details...

Description

The Grid supports aggregates which will be displayed at the footer, group footer and group caption of the Grid. The aggregate configurations can be provided by the aggregates property. The built-in aggregates are, Sum Average Min Max Count TrueCount FalseCount Custom - 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 in the Grid footer. In the first aggregate row, the Sum aggregate type is used by setting the type and field property as Freight which will be used to perform the aggregation. The aggregate value is accessed inside the footerTemplate using its type name (${Sum}). The aggregate value will be formatted based on its format value(C2) before being displayed. The template expression should be provided inside ${...} the interpolation syntax. Injecting Module: Grid features are segregated into individual feature-wise modules. To use aggregate feature, we need to inject Aggregate module using the Grid.Inject(Aggregate) section.