Example of Default Aggregate in Javascript Tree Grid Control

/
/
Default Aggregate

This sample demonstrates aggregate functionality of the Tree Grid. In this sample, the aggregate value for the columns “Total Units”, “Total Cost” and “Unit Weight” is displayed in column footer and provide an option to show child summary.

More Details...

CX2389NK
Maersk Edibles Co.24159
QW4567OP
Chang5012
QW3458BH
Aniseed Syrup8789
QW8967OH
Chef Anton5446
QW6549NJ
Chef Antons Gumbo Mix5034
Maximum: 87Minimum: 12
DW8954IO
Aeon fitness inc.296172
UF5647YH
Reebox CrossFit Back Bay7360
UF1290LK
The Green Microgym9056
UF8956KU
DeFrancos6845
UF7464JK
Westside Barbell6525
Maximum: 90Minimum: 25
EJ9456KN
Sun technologies inc19233
GH2367OP
Haier Group2378
GH4309TH
Panda Electronics4890
GH3494SD
Jiangsu Etern5636
GH3213FR
Zhejiang Fuchunjiang6512
Maximum: 65Minimum: 12
Show Child Summary
Description

The Tree Grid supports aggregates which will be displayed at the footer and every hierarchy level. 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 three different aggregates in the Tree Grid footer. Showing minimum aggregate for “Total Units” column and the footerTemplate using its type name as (${Min}). Showing maximum aggregate for “Total Cost” column and the footerTemplate using its type name as (${Max}). Showing average aggregate for “Unit weight column” column and the footerTemplate using its type name as (${Average}). The template expression should be provided inside ${...} the interpolation syntax. Additionally, the Tree Grid supports client-side exporting to Excel, PDF, and CSV formats. In this demo, for the toolbar items of exporting, actions are defined in the toolbarClick event to export the Tree Grid data using the excelExport, pdfExport, and csvExport methods. Injecting Module: Tree Grid features are segregated into individual feature-wise modules. To use aggregate feature, we need to inject Aggregate module using the TreeGrid.Inject(Aggregate) section. More information about aggregate can be found in this documentation section.