Reputation: 143
How to fill custom colors in jqxGrid (jqwidget) cells dynamic by changing the cell value?
Upvotes: 0
Views: 3127
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
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