hi,
I need to assign a color for the background of a cell based on a certain value:
-ve => cell background will be in red
+ve => cell background will be in green
I have check the following code on demo, to color the text. But I need to color the cell background:
var cellsrenderer = function (row, columnfield, value, defaulthtml, columnproperties) { if (value < 20) { return '<span style="margin: 4px; float: ' + columnproperties.cellsalign + '; color: #ff0000;">' + value + '</span>'; } else { return '<span style="margin: 4px; float: ' + columnproperties.cellsalign + '; color: #008000;">' + value + '</span>'; } }