EXTJS4:如何改变grid某一个单元格的背景颜色
2012-09-12 09:21
609 查看
测试环境: ext-4.1.0-gpl
JS CODE:
所用到的自定义CSS :
JS CODE:
Ext.onReady(function () { Ext.widget('grid', { title: 'Users', store: { fields: ['name', 'email', 'online'], data: [ { 'name': 'Lisa', "email": "lisa@simpsons.com", "online": true }, { 'name': 'Bart', "email": "bart@simpsons.com", "online": false }, { 'name': 'Homer', "email": "home@simpsons.com", "online": true }, { 'name': 'Marge', "email": "marge@simpsons.com", "online": true } ] }, columns: [ { header: 'Name', dataIndex: 'name', renderer: function (value, meta, record) { meta.tdCls = record.get('online') ? 'user-online' : 'user-offline'; return value; } }, { header: 'Email', dataIndex: 'email', flex: 1 }, { header: 'Online', dataIndex: 'online' } ], width: 400, renderTo: 'output' }); });
所用到的自定义CSS :
.x-grid-cell.user-online { background-color: #9fc; } .x-grid-cell.user-offline { background-color: #ffc; }
相关文章推荐
- ExtJS4 Grid改变单元格背景颜色及Column render学习
- ExtJS Grid 改变单元格背景颜色的方法
- EXTJS GRID 改变单元格背景颜色的方法
- ExtJS4.2 Grid知识点三:改变表格Grid单元格背景颜色
- ExtJS4 Grid改变单元格背景颜色
- EXTJS GRID 改变单元格背景颜色的方法
- ExtJS Grid 改变单元格背景颜色的方法
- ExtJS4.2 Grid知识点二:改变Grid表格行背景颜色
- ExtJS4 Grid改变单元格背景颜色及Column render学习
- WPF中datagrid控件如何获得某个单元格并改变其背景颜色
- 界面上单元格的可操作性和背景颜色根据某一个单元格值的变化而发生改变
- ExtJS4.2 Grid知识点一:改变表格Grid单元格文字颜色
- WPF中ListView如何改变选中条背景颜色
- asp.net 如何改变GridView搜索出来关键字的颜色?就像百度似的,我获得的是一个集合,改变集合中关键字的集合
- VS2010下如何改变Button颜色、背景、边框
- 如何改变视窗的背景颜色
- extjs grid设置某列背景颜色
- clistctrl改变单元格的背景颜色
- VC6.0中如何改变对话框的背景颜色
- [原创]可改变单元格字体和背景颜色的CListCtrl