This sample demonstrates aggregate functionality of the Tree Grid. In this sample, the aggregate value for the columns “Total Units” and “Unit Weight” is displayed in column footer and provide an option to show child summary.
Freight ID | Freight Name | Total Units | Weight Per Unit |
---|---|---|---|
CX2389NK | Maersk Edibles Co. | 59 | 241 |
QW4567OP | Chang | 12 | 50 |
QW3458BH | Aniseed Syrup | 89 | 87 |
QW8967OH | Chef Anton | 46 | 54 |
QW6549NJ | Chef Antons Gumbo Mix | 34 | 50 |
Minimum: 12 | Maximum: 87 | ||
DW8954IO | Aeon fitness inc. | 172 | 296 |
UF5647YH | Reebox CrossFit Back Bay | 60 | 73 |
UF1290LK | The Green Microgym | 56 | 90 |
UF8956KU | DeFrancos | 45 | 68 |
UF7464JK | Westside Barbell | 25 | 65 |
Minimum: 25 | Maximum: 90 | ||
EJ9456KN | Sun technologies inc | 33 | 192 |
GH2367OP | Haier Group | 78 | 23 |
GH4309TH | Panda Electronics | 90 | 48 |
GH3494SD | Jiangsu Etern | 36 | 56 |
GH3213FR | Zhejiang Fuchunjiang | 12 | 65 |
Minimum: 12 | Maximum: 65 |
Show Child Summary |
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.
(${'Min'})
.(${'Max'})
.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 into the services.
More information about aggregate can be found in this documentation section.