修改了grid的前3行的颜色为红色

viewConfig:{
                   rowOverCls : 'my-row-over',//鼠标移过的行样式
                     selectedRowClass : "my-row-selected",//选中行的样式
                     getRowClass : function(record,rowIndex,rowParams,store){  //指定行的样式
                       if(rowIndex <=2){
                        return "my-row";
                       }
                      }
                 },

在相应的页面:

  <style type="text/css">
    .my-row{background-color: red}
    </style>

原文地址:https://www.cnblogs.com/kunpengit/p/2756710.html