我有如下一个ExtJS的ListView控件:ExtJS的ListView控件 - 设置背景颜色为特定行
var myList = new Ext.list.ListView({ id:'mylist-view', store: mystore, multiSelect: true, emptyText: 'No content to display', reserveScrollOffset: true, columns: [{ header: 'Header-1', width: .3, dataIndex: 'data-1' },{ header: 'Header-2', width: .3, dataIndex: 'data-2', align: 'right' },{ header: 'Header-3', width: .3, dataIndex: 'data-3', align: 'right' }], });
我要为特定的行不同的背景颜色。我该怎么做?
我称之为提供了类似的问题,一些其他的解决方案,并尝试了以下内容:
viewConfig: {
getRowClass: function(record, index, rowParams, ds) {
return record.get('data-1') == 'Total' ? 'background-color: #EEEEEE' : '';
}
}
但是,这并没有帮助。
上述修复程序无效。 – user3318300
它应该工作。看看这个例子:https://fiddle.sencha.com/#fiddle/3p8 – Akatum