Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 9617ccb

Browse files
committed
(grouping): respect customTreeAggregationFn when grouping columns
Fixes angular-ui#6402
1 parent 1051dee commit 9617ccb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/features/grouping/js/grouping.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,13 @@
684684
}
685685

686686
column.treeAggregation = { type: uiGridGroupingConstants.aggregation.COUNT, source: 'grouping' };
687-
column.treeAggregationFn = uiGridTreeBaseService.nativeAggregations()[uiGridGroupingConstants.aggregation.COUNT].aggregationFn;
687+
688+
if ( typeof(column.colDef.customTreeAggregationFn) !== 'undefined' ) {
689+
column.treeAggregationFn = column.colDef.customTreeAggregationFn;
690+
} else {
691+
column.treeAggregationFn = uiGridTreeBaseService.nativeAggregations()[uiGridGroupingConstants.aggregation.COUNT].aggregationFn;
692+
}
693+
688694
column.treeAggregationFinalizerFn = service.groupedFinalizerFn;
689695

690696
grid.api.grouping.raise.groupingChanged(column);

0 commit comments

Comments
 (0)