今天子啊easyui开发前端的时候,需要根据行的数据情况,动态显示行的背景颜色,遇到这种情况,解决办法是:
$('#dg').datagrid({
rowStyler: function(index,row){
var info = row.sremark;
if(info!=null && ($.trim(info).length>0)){ //加上即可进行判断
return 'background-color:#6293BB;color:#fff;'; // return inline style
// the function can return predefined css class and inline style
// return {class:'r1', style:{'color:#fff'}};
}
}
});