Reputation: 816
I want to change background colors(say,red) of all cells in a column(say, Total Sale) where column value is more than x(say, 10)? How can this be achieved.
Upvotes: 0
Views: 2834
Reputation: 20740
You can use formatter
for total
column.
{
name: "total",
index: "total",
formatter: function(cellvalue, options, rowObject){
if(cellvalue>10)
return '<span style="background-color: red; display: block; width: 100%; height: 100%; ">' + cellvalue + '</span>';
else
return cellvalue;
}
}
Upvotes: 1