Skip to content

Commit

Permalink
fix(grouping): respect customTreeAggregationFn on grouped columns (#6868
Browse files Browse the repository at this point in the history
)

Fixes #6402
  • Loading branch information
MartijnWelker authored and mportuga committed Oct 16, 2018
1 parent 24d4224 commit e2a7310
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/features/grouping/js/grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,13 @@
}

column.treeAggregation = { type: uiGridGroupingConstants.aggregation.COUNT, source: 'grouping' };
column.treeAggregationFn = uiGridTreeBaseService.nativeAggregations()[uiGridGroupingConstants.aggregation.COUNT].aggregationFn;

if ( typeof(column.colDef.customTreeAggregationFn) !== 'undefined' ) {
column.treeAggregationFn = column.colDef.customTreeAggregationFn;
} else {
column.treeAggregationFn = uiGridTreeBaseService.nativeAggregations()[uiGridGroupingConstants.aggregation.COUNT].aggregationFn;
}

column.treeAggregationFinalizerFn = service.groupedFinalizerFn;

grid.api.grouping.raise.groupingChanged(column);
Expand Down

0 comments on commit e2a7310

Please sign in to comment.