Extjs控制GridPanel中特定单元格的内容及样式

来源:岁月联盟 编辑:exp 时间:2012-02-04
如下,当"当前状态"列中的内容是1时,将其变为"异常",并红色显示出来
 
 
{
 
   header: '当前状态',
   align: 'center',
   dataIndex: 'IsWork',
sortable: true,
//menuDisabled:true,
   width: 80,
renderer:function(value,cellmeta,record, rowIndex, columnIndex, store){
if(value != 1){
value = "异常";
cellmeta.css="RedFont";
}else{
value = "正常";
}
return value;
}
   }
 
 
.RedFont{
color:#ff0000;
}


摘自 漂泊小柒的专栏