You have to use a row template. In this template you can use ng-class
and dynamically assign a CSS class by databinding.
A simple example:
HTML
<body ng-controller="MyCtrl">
<div class="grid" ng-grid="gridOptions"></div>
</body>
JavaScript
var app = angular.module('myApp', ['ngGrid']);
app.controller('MyCtrl', function($scope) {
$scope.fileOneUploaded = true;
$scope.fileTwoUploaded = false;
$scope.gridData = [{fileName: 'File 1', size: 1000, isUploaded: $scope.fileOneUploaded },
{fileName: 'File 2', size: 2000, isUploaded: $scope.fileTwoUploaded }];
$scope.gridOptions = {
data: 'gridData',
rowTemplate: '<div style="height: 100%" ng-class="{red: !row.getProperty(\'isUploaded\')}">' +
'<div ng-repeat="col in renderedColumns" ng-class="col.colIndex()" class="ngCell ">' +
'<div ng-cell></div>' +
'</div>' +
'</div>'
}
});
CSS
.grid {
width: 300px;
height: 100px;
border: solid 1px rgb(90,90,90);
}
.red {
background-color: red;
color: white;
}
ng-class
based onwhatever variable you need to momitor. See docs for link to github wiki regarding templates – UnbiasedrowTemplate
config option. – Ronaronal