2

I am using the sum aggregate to calculate some totals in an angular ui-grid.

The totals get displayed just fine but I could not figure out how to change the label that gets preceeds to the total.

if the total is 5000 for example, the footer will display : total : 5000

How do I remove the word total ? I see it in the source but I cannot figure out how to change it without changing the source.

Thanks

3 Answers 3

2

I found the 'undocumented' (http://ui-grid.info/docs/#/api/ui.grid.class:GridOptions.columnDef) property that can be used for this purpose : aggregationLabel

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

Comments

2

you can remove that just bu adding this function

$scope.hideAgregationChar = function( aggregation ){
    aggregation.rendered = aggregation.value;
    };

and in your grid definition add this

customTreeAggregationFinalizerFn: $scope.hideAgregationChar,

or if you wan to change the word to another one just change the cell templates like this

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

that will change the total to Total for example.

Comments

0

You have to include just footerCellTemplate as below for that particular column which you need to aggregate sum.

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

for example, the above line will change the total to Total.

Comments

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.