EasyUI中DataGrid隔行改变背景颜色。

       <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'">  

 

posted @ 2017-10-01 10:34  longdb  阅读(4478)  评论(0编辑  收藏  举报