Angularjs Ui grid formatting required

I am using Angularjs ui grouping functionality. See Image. When displaying the group sum by default, it is displayed as "total:" but I want to change it to "Total" (capital "T") and also I want to limit the aggregated totals to two decimal numbers. Where do 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

+3


source to share


1 answer


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

The footerTemplate folder can only be configured to display two decimal places



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 decimal places.

+5


source







All Articles