当前位置:编程学习 > JS >>

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

如下,当"当前状态"列中的内容是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;
}


摘自 漂泊小柒的专栏
补充:web前端 , JavaScript ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,