css
.my_row_red .x-grid-cell { //一定要加后面-cell class名称,否则无效
background-color: red;
}
js
new Ext.grid.panel({
...
viewConfig : {
forceFit : true,
getRowClass : function(record, rowIndex, rowParams, store) {
if (record.data.status> 0) {
return 'my_row_red'; //返回的class name
}
}
}
})
本文探讨了如何利用CSS的.my_row_red.x-grid-cell类样式和JavaScript的getRowClass方法来实现网格面板中行背景颜色的动态变化,具体展示了在不同状态下的样式应用。
5708

被折叠的 条评论
为什么被折叠?



