if语句必须将列中的元素与“ N / A”进行比较 并更改bg的颜色(如果为true)..即使有名为“ N / A”的元素,它也不会返回true。请参考下面的代码。
{
headerName: "Gen Barcode", field: "genbarcode", width: 130,
cellClass: function(params) {
return params.value === "N/A" ? "grey" : "null";
}
}
答案 0 :(得分:0)
有几件事要测试,以查看问题所在。
确保实际上已传递值“ N / A”。
{ headerName: "Gen Barcode", field: "genbarcode", width: 130,
cellClass: function(params) {
console.log(params.value === "N/A");
return params.value === "N/A" ? "grey" : "null";
}
}
确保CSS类“灰色”确实有效。
{ headerName: "Gen Barcode", field: "genbarcode", width: 130,
cellClass: "grey";
}