footerCellClass function gets called only once
I need a way to show footer sum in red for negative numbers and black with positive numbers. I am trying to achieve this using footerCellClass. The problem is that it gets called only once even before the data is loaded.
I tried this with a plunker and it looks like the function is getting called post-filter, but one digest too late: http://plnkr.co/edit/M4r1RE029TnRD48uSvc3?p=preview
If you filter the column it will update the color, but using the LAST aggregation value...
Hi @c0bra ,
I made a small change to fix this locally. It seems to work.
In uiGridFooterCell directive,
- Comment the following lines //if ($scope.col.footerCellClass) { // updateClass(); //}
- Listen to rowsRendered to call updateClass
$scope.grid.api.core.on.rowsRendered( $scope, $scope.col.updateAggregationValue ); $scope.grid.api.core.on.rowsRendered( $scope, updateClass ); $scope.$watch( $scope.col, updateClass );
$scope.$on( '$destroy', dataChangeDereg );