{field:'ischeck',title:'是否通过审核',width:50,align:'center',styler: function(value,row,index){ if (value == "未通过"){return 'background:yellow;color:red;';} else if(value == "已通过"){return 'color:green;';}} },
效果图:
附上easyui官方styler的参考api
官方对styler的解释:
The cell styler function, return style string to custom the cell
style such as 'background:red'. The function take three parameter:
value: the field value.
rowData: the row record data.
rowIndex: the row index.
Code example:
$('#dg').datagrid({ columns:[[ {field:'listprice',title:'List Price', width:80, align:'right', styler: function(value,row,index){ if (value < 20){ return 'background-color:#ffee00;color:red;'; } } } ]] });
本文链接:https://www.92ez.com/?action=show&id=400
!!! 转载请先联系non3gov@gmail.com授权并在显著位置注明作者和原文链接 !!! 小黑屋
提示:技术文章有一定的时效性,请先确认是否适用你当前的系统环境。
!!! 转载请先联系non3gov@gmail.com授权并在显著位置注明作者和原文链接 !!! 小黑屋
提示:技术文章有一定的时效性,请先确认是否适用你当前的系统环境。