Jqgrid设置单元格背景颜色

5 jquery colors jqgrid

在" jqGrid 3.4中的自定义数据工具提示"讨论中,了解了如何使用setcell更改jqgrid单元格内文本的颜色.我们怎样才能改变细胞的背景颜色?

试过以下

jQuery("#list").setCell (row,col,'',{ background-color:'red'});

jQuery("#list").setCell (row,col,'','',{ bgcolor:'red'};
Run Code Online (Sandbox Code Playgroud)

Jon*_*ers 13

使用背景而不是背景颜色等特定规则:

jQuery("#list").setCell (row,col,val,{background:'#ff0000'});
Run Code Online (Sandbox Code Playgroud)


Dan*_*ura 1

jQuery('#list').setCell('12','name','',{'background-color': 'red'},'');
Run Code Online (Sandbox Code Playgroud)

您是否输入了正确的行 ID?正确的colName?

您还缺少背景颜色中的引号。