<t:dgCol title="任务类型"  field="type" align="center" extendParams="'styler':fmtype;" query="true" queryMode="single"  width="100"></t:dgCol>

extendParams属性添加js方法,然后再调用方法

function fmtype(val,row,index){
   var s1 = 'background-color: #f89406;;border-radius: 5px;color:#fff;';
   var s2 = 'background-color: #3a87ad;border-radius: 5px;color:#fff';
    if (val =='W') {
       return s1
   }
    if (val =='J') {
       return s2
    }
}

 

相关文章: