我的用例如下:
有一个像这样的表:
+------------------------------+ | NOTICE | This is notice #1 | | WARNING | This is warning #1 | | NOTICE | This is notice #2 | | ERROR | This is error #1 | +------------------------------+
I'd like to have a specific background color for the whole rows depending of the value of first column.
To implement this, I'd like to make use of a class applied on the row so that I can skin it easily with:
tr.NOTICE td {background-color: Yellow}
tr.WARNING td {background-color: Orange}
tr.ERROR td {background-color: OrangeRed}
不确定是否可以使用 jqGrid,也许使用自定义格式化程序?不知道怎么办
提前致谢
最佳答案
这对我有用:
afterInsertRow:function(rowid, rowdata, rowelem){
var status = rowdata['status'];
if(status=='0'){
$("tr.jqgrow#"+rowid).addClass("ui-state-error");
}
}
关于css - 如何使用 jqgrid 根据单元格数据应用行样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2036671/