Aggregates in JavaScript TreeGrid
Aggregate values are displayed in the TreeGrid footer and in parent row footer for child row aggregate values. It can be configured through aggregates property.
field and type are the minimum properties required to represent an aggregate column.
To use the aggregate feature, you have to inject the Aggregate module.
By default, the aggregate value can be displayed in the treegrid footer, and footer of child rows. To show the aggregate value in one of the cells, use the footerTemplate.
Built-in aggregate types
The aggregate type should be specified in the type property to configure an aggregate column.
The built-in aggregates are,
- Sum
- Average
- Min
- Max
- Count
- Truecount
- Falsecount
- Multiple aggregates can be used for an aggregate column by setting the
typeproperty with an array of aggregate types.- Multiple types for a column is supported only when one of the aggregate templates is used.
Child aggregate
Aggregate value is calculated for child rows, and it is displayed in the parent row footer. Use the childSummary property to render the child rows aggregate value.
You can refer to our
JavaScript Tree Gridfeature tour page for its groundbreaking feature representations. You can also explore our JavaScript Tree Grid exampleJavaScript Tree Grid exampleto knows how to present and manipulate data.