dynamiccellbackground-colorjqxgridjqwidget

How to fill custom colors in jqxGrid (jqwidget) cells by changing the cell value?


How to fill custom colors in jqxGrid (jqwidget) cells dynamic by changing the cell value?


Solution

  • If you want to set the background color of a cell based on the value, you can just use a custom renderer for the column.

    cellsrenderer: function(row, column, value) {
      var color = getColorForValue(value),     //function you write to determine the color
          display = getDisplayForValue(value); // function you write to determine what's displayed [optional]
      return '<div style="background-color: ' + color + '">' + display + '</div>';
    }