根据jqgrid中的特定条件设置列中单元格的背景颜色

Set background color of cell in a column based on a particular condition in jqgrid

我想更改列值大于 x(例如,10)的列(例如,总销售额)中所有单元格的背景颜色(例如,红色)?如何实现。

您可以对 total 列使用 formatter

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

DEMO