Extjs4 单元格变色
来源:互联网 发布:360彩票源码 编辑:程序博客网 时间:2024/04/30 16:07
Ext.create('Ext.grid.Panel', { store: Ext.getStore("taskDataStore"), id: "gridView", columnLines: true, columns: [ { text: '人员名称', width: 60, sortable: true, dataIndex: 'ClientUserName', align: 'left', renderer: fnColumnColor },function fnColumnColor(){ var vint = parseInt(value); if (vint <= 80) { metaData.style = "background-color: Red"; } else if (vint > 80 && vint < 100) { metaData.style = "background-color: Orange"; } else if (vint == 100) { } return value;}行变色________________________________________grid viewConfig : { getRowClass: fnRowRenderer }function fnRowRenderer(record, rowIndex, rowParams, store) { var cls; var percentint = parseInt(record.data.WorkingHoursEfficiency); if (percentint <= 80) { cls = "x-grid-back-below80"; } else if (percentint > 80 && percentint < 100) { cls = "x-grid-back-above80"; } else if (percentint == 100) { cls = "x-grid-back-100"; } return cls;}