Skip to content

Commit

Permalink
fix(grouping): adds aggregationLabel to aggregateColumn call to match
Browse files Browse the repository at this point in the history
public API
  • Loading branch information
Chad Baldwin authored and mportuga committed Nov 4, 2019
1 parent 06f16f8 commit 60fcedc
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/grouping/src/js/grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,8 +747,9 @@
* @param {Grid} grid grid object
* @param {GridColumn} column the column we want to aggregate
* @param {string} aggregationType of the recognised types from uiGridGroupingConstants or one of the custom aggregations from gridOptions
* @param {string} aggregationLabel to be used instead of the default label. If empty string is passed, label is omitted
*/
aggregateColumn: function( grid, column, aggregationType) {
aggregateColumn: function( grid, column, aggregationType, aggregationLabel ) {
if (typeof(column.grouping) !== 'undefined' && typeof(column.grouping.groupPriority) !== 'undefined' && column.grouping.groupPriority >= 0) {
service.ungroupColumn( grid, column );
}
Expand All @@ -761,7 +762,12 @@
aggregationDef = uiGridTreeBaseService.nativeAggregations()[aggregationType];
}

column.treeAggregation = { type: aggregationType, label: i18nService.get().aggregation[aggregationDef.label] || aggregationDef.label };
column.treeAggregation = {
type: aggregationType,
label: ( typeof aggregationLabel === 'string') ?
aggregationLabel :
i18nService.get().aggregation[aggregationDef.label] || aggregationDef.label
};
column.treeAggregationFn = aggregationDef.aggregationFn;
column.treeAggregationFinalizerFn = aggregationDef.finalizerFn;

Expand Down

0 comments on commit 60fcedc

Please sign in to comment.