【发布时间】:2019-09-11 11:04:04
【问题描述】:
我有一个带有单元格选择的树形面板:
selModel: Ext.create('Ext.selection.CellModel', {
listeners: {
select: function (cellModel, record, rowIndex) {
var myGrid = Ext.ComponentQuery.query('view #grid')[0];
myGrid.getView().addRowCls(rowIndex, 'style');
},
deselect: function (cellModel, record, rowIndex) {
var myGrid = Ext.ComponentQuery.query('view #grid')[0];
myGrid.getView().removeRowCls(rowIndex, 'style');
},
scope: this
}
}),
并且列有tdCls 属性:
tdCls : 'greyColumn/yellowColumn', //It depends on the position
- grayColumn/yellowColumn STYLE -
.x-grid-row .greyColumn{
background-color:#f2f2f2;
}
.x-grid-row .yellowColumn {
background-color:#ffffcc;
}
- selModel STYLE -
.x-grid-row .style{
background-color: red !important;
}
tdCls 属性完美运行,单元格颜色正确。
但是当我选择一个单元格时,该行没有变成红色。
知道我做错了什么吗??
【问题讨论】: