核心代码:
var clsRender = function(value){ if (value == 'male') { return "<span style='color:red;font-weight:bold;'>红男</span>"; } else { return "<span style='color:green;font-weight:bold;'>绿女</span>"; } }},
var cm = new Ext.grid.ColumnModel([ {header:'编号',dataIndex:'id'}, {header:'性别',dataIndex:'sex',renderer:clsRender}, {header:'名称',dataIndex:'name'}, {header:'描述',dataIndex:'descn',renderer:renderDescn} ]);