Filtering can be configured to impact aggregate values in the grid.
Ignore Filters when Aggregating
When using Filters and Aggregations together, the aggregated values reflect only the rows which have passed the filter. This can be changed to instead ignore applied filters by using the suppressAggFilteredOnly
grid option.
The example above demonstrates the impact of the suppressAggFilteredOnly
grid option. This can be enabled as shown:
const gridOptions = {
suppressAggFilteredOnly: true,
// other grid options ...
}
Filtering for Aggregated Values
The grid only applies filters to leaf level rows, this can be toggled to instead also apply filtering to group rows by enabling the groupAggFiltering
grid option, allowing filters to also apply against the aggregated values.
Take note of the following while using groupAggFiltering
:
- When a group row passes a filter, it also includes all of its descendent rows in the filtered results.
- The
suppressAggFilteredOnly
grid option will be implicitly enabled. - Set Filters will only work with leaf rows.
The following configuration demonstrates how to enable group aggregation filtering:
const gridOptions = {
groupAggFiltering: true,
// other grid options ...
}
Configure by Callback
When filtering for aggregated values the filter applies to all group rows by default. This can be configured more granularly by instead providing the groupAggFiltering
grid option with a callback function.
The example below demonstrates a grid configured to apply filters only to aggregated values, and not the leaf rows:
The configuration below demonstrates how to only apply test filters against group rows, and not leaf rows:
const gridOptions = {
groupAggFiltering: (params) => !!params.node.group,
// other grid options ...
}