title: Angularjs ui-grid change row background color
body: <p>I have this code in plunker that I cant make it to work : <a href="http://plnkr.co/edit/BRgQKUwHGUFpYtm1W258" rel="nofollow">plunker</a></p>
  
  <pre><code>var app = angular.module('app', ['ngAnimate', 'ui.grid']);
  
  app.controller('MainCtrl', ['$scope', '$http', function ($scope, $http) {
  
    $scope.myData = [{sv_name: "Moroni", sv_code: 50,count:0},
                   {sv_name: "Tiancum", sv_code: 43,count:1},
                   {sv_name: "Jacob", sv_code: 27,count:0},
                   {sv_name: "Nephi", sv_code: 29,count:7},
                   {sv_name: "Enos", sv_code: 34,count:0}];
  
     $scope.getBkgColorTable = function (saveStatus) {
                  switch (saveStatus) {
                      case -1:
                          return "";
                          break;
                      case 0:
                          return "#dff0d8";
                          break;
                      default:// anything but 0 and -1, alerts
                          return "#f2dede";
                  }
              };
  
    //ng-class="{\'green\':true, \'red\':row.entity.count==0 }"
    var rowtpl='&lt;div&gt;&lt;div style="{\'background-color\': getBkgColorTable(myData[row.rowIndex].count)}" ng-repeat="(colRenderIndex, col) in colContainer.renderedColumns track by col.colDef.name" class="ui-grid-cell" ng-class="{ \'ui-grid-row-header-cell\': col.isRowHeader }" ui-grid-cell&gt;&lt;/div&gt;&lt;/div&gt;';
  
    $scope.gridOptions = {
      enableSorting: true,
      data:'myData',
  
      rowTemplate:rowtpl,
      columnDefs: [
        { field: 'sv_name', displayName: 'Nombre',},
        { field: 'sv_code', displayName: 'Placa'},
        { field: 'count'}
      ]
    };
  
  
  }]);
  </code></pre>
  
  <p>The idea is to check status field in the grid and change the background color of the grid.</p>
  
  <p>Regards</p>
  
  <p>Carlos</p>