如何改变easyui datagrid 单元格的背景与字体颜色


<script type="text/javascript">

//设置列中字体的颜色,可以根据行索引row和列索index做判断
function setColumnForeColor(value, row, index)
{
return "<span style='color: black'>" + value + "</span>";
}

//设置列单元格的背景颜色,可以根据行索引row和列索index做判断
function setColumnBackColor(value, row, index)
{
return 'background-color: #efefef;';
}
</script>

<!-- 下面是两个列格式化器,styler 管背景,formatter 管字体 -->
<th field="RecNo" styler="setColumnBackColor" formatter="setColumnForeColor"></th>
 
————————————————
版权声明:本文为CSDN博主「长沙三毛」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/hulihui/java/article/details/88380454

原文地址:https://www.cnblogs.com/ljs-13/p/13083952.html