-1

hi i am working on angular ui grid for an about couple of days And now my is question is that if the sum of total is negative then the color of that particular footer must be in red color

examples total= -50000

-5000 must be in red color  and remaining colors must be asusual 

1 Answer 1

0

You can use the cellClass property of the column in the column defs. This property can take either a static class name or a function.
For example (taken from: http://brianhann.com/customize-ui-grid-with-dynamic-cell-classes/):

$scope.gridOptions = {
  enableSorting: true,
  columnDefs: [
    { field: 'name' },
    { field: 'gender',
      cellClass: function(grid, row, col, rowRenderIndex, colRenderIndex) {
        if (grid.getCellValue(row ,col).toLowerCase() === 'male') {
          return 'red';
        }
      }
    }
  ]
};
Sign up to request clarification or add additional context in comments.

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.