Ext.grid.GridPanel根据某列改变行的颜色

<style>
.x-grid-record-red table{
   background: #E6D1E3;
}
.x-grid-record-yellow table{
   background: #F3FEC2;
}
.x-grid-record-green table{
   background: #92FCCC;
}
</style>

 

 var qGridPanel = new Ext.grid.GridPanel({
    // 表格面板标题,默认为粗体,我不喜欢粗体,这里设置样式将其格式为正常字体
    title                : '<span class="commoncss">我发起的工作任务</span>',
    height           : 500,
    id                   : 'id_grid_jobTaskinfo',
    autoScroll    : true,
    frame            : true,
    region           : 'center',          
    store             : qGridStore,          
    stripeRows  : true,           
    cm                 : qGridColumns,         
    tbar                : tbar,           
    bbar               : bbar,          
    viewConfig    : {
             getRowClass : function(record,rowIndex,rowParams,store){
                  if(record.data.status == '3' || record.data.status == '7' || record.data.status == '8'){     //正常关闭、责任人原因中止、发起人原因中止 
                           return 'x-grid-record-red';
                  }
                 if(record.data.status == '2' || record.data.status == '5' || record.data.status == '6'){
                           return 'x-grid-record-yellow';
                 }
                 if(record.data.status == '1' || record.data.status == '4'){
                          return 'x-grid-record-green';
                  }
            }
  }
   ,
  loadMask          : {
         msg             : '正在加载表格数据,请稍等...'
  }
  });

Ext.grid.GridPanel根据某列改变行的颜色_第1张图片

 

 

 

 

 

 

 

 

你可能感兴趣的:(工作,function,table,Class,任务)