如何改变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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM