easyui datagrid隔行变色
属性striped设置为true,即striped:true。
如果想更改颜色,可以更改easyui.css中的.datagrid-row-alt样式。
或者:
<table id="dg" class="easyui-datagrid" style="width: 1000px; height: 300px"
data-options="
rownumbers:true,
onClickRow:ClickRow,
singleSelect:false,
border:true,
pagination:true,
url:'DataGridDataHandler.ashx',
<%-- //隔行变色--%>
rowStyler: function(index,row){
if ((index % 2)==0){
return 'background-color:#0000C6;color:#fff;font-weight:bold;';
}
else{
return 'background-color:#009100;color:#fff;font-weight:bold;';
}
},
toolbar:'#tb'">
本文来自博客园,作者:IT情深,转载请注明原文链接:https://www.cnblogs.com/wh445306/p/16751813.html