rgb
rgb

Reputation: 143

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?

Upvotes: 0

Views: 3127

Answers (2)

scripto
scripto

Reputation: 2297

I would suggest you for changing cell color, background or some other CSS styles to use the "cellclassname" instead. Example: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/gridcellclass.htm?arctic

Upvotes: 0

dfperry
dfperry

Reputation: 2258

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>';
} 

Upvotes: 1

Related Questions