3

I am using Angularjs ui grid grouping functionality. Please see the image, When displaying group sum, by default it is getting displayed as 'total :' but I want to change it to 'Total' (capital 'T') and also I want to restrict aggregated totals to 2 decimal numbers. Where I need to change the settings?

The following is my colDef for the Ui Grid:

angular.forEach(columns, function(value, key) {
        columnDefs.push({
            name: key,
            displayName: value,
            enableCellEdit: false,
            aggregationType: uiGridConstants.aggregationTypes.sum,
            width: '8%'
        })
    });

uiGridGrouping

1 Answer 1

5

If you want to customize the column footer , you need to provide a footerCellTemplate to the column.

The footerTemplate can be configured to only show two decimals

footerCellTemplate: '<div class="ui-grid-cell-contents">\'Total\' (capital \'T\') {{col.getAggregationValue() | number:2 }}</div>'

http://plnkr.co/edit/u75EC8gxdIBxHzthaH15?p=preview shows an example where you can change the label and decimals.

Sign up to request clarification or add additional context in comments.

1 Comment

is it possible to make same thing for the grouping cells? is it possible to delete the aggregate notes like total, Max ....?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.