Search code examples
angularag-gridag-grid-angular

Ag-grid. Change Row Color After Cell Value Is Changed


When a cell is updated, I would like the row to change color.

I have been able to update the cell color but not the row color

      onCellValueChanged: function(params) {
        if (params.oldValue !== params.newValue) {
          params.colDef.cellStyle = function(params) {
            return { backgroundColor: 'green' };
          };
        }
      }

Solution

  • gridOptions.getRowStyle = function(params) {
       if (params.node.rowIndex === 'the index of row you want to change color ') {
          return { background: 'red' }
       }
    }