EXTJS 5树状网格自定义行css
EXTJS 5 Tree grid custom row css
我有一个树网格,我想更改父行和子行的css(在我的情况下是背景色)。我做了一些css类,并使用了viewConfig.getRowClass方法,但它不适用于悬停和选择。
以下是我的问题:https://fiddle.sencha.com/#fiddle/jl1
这是我的树网格:
var tree = Ext.create('Ext.tree.Panel', {
renderTo: Ext.getBody(),
title: 'TreeGrid',
rootVisible: false,
width: 300,
height: 250,
store: store,
viewConfig: {
getRowClass: function(record, index) {
if (record.get('name').indexOf('Group') != -1) {
return 'row-parent';
}
return 'row-child';
}
},
columns: [{
xtype: 'treecolumn',
text: 'Name',
dataIndex: 'name',
width: 150
}, {
text: 'Description',
dataIndex: 'description',
width: 150
}]
});
这是我的css:
.row-parent .x-grid-cell {
background-color: #c1ddf1 !important;
}
.row-parent .x-grid-row-over .x-grid-cell {
background-color: #3da5f5 !important;
}
.row-parent .x-grid-row-selected .x-grid-cell {
background-color: #ff0 !important;
}
.row-child .x-grid-cell {
background-color: #e2eff8 !important;
}
.row-child .x-grid-row-over .x-grid-cell {
background-color: #85c4f5 !important;
}
.row-child .x-grid-row-selected .x-grid-cell {
background-color: #ff0 !important;
}
你知道为什么选择和悬停css不起作用吗?
提前感谢=)!
.row-parent .x-grid-cell {
background-color: #c1ddf1 !important;
}
.x-grid-item-over .row-parent .x-grid-cell {
background-color: #3da5f5 !important;
}
.x-grid-item-selected .row-parent .x-grid-cell {
background-color: #ff0 !important;
}
.row-child .x-grid-cell {
background-color: #e2eff8 !important;
}
.x-grid-item-over .row-child .x-grid-cell {
background-color: #85c4f5 !important;
}
.x-grid-item-selected .row-child .x-grid-cell {
background-color: #ff0 !important;
}
相关文章:
- 使用自定义css在页面中弹出,而不覆盖页面's css
- 将自定义css保持在角度范围内
- 不使用自定义CSS或HTML(使用框架方法)的角度材质文本输入或文本区域标签大小
- Meteor:选择自定义javascript和自定义css作为模板
- 自定义 CSS 媒体打印查询中的模式高度和宽度
- 通过应用自定义 css 类禁用 html 输入元素
- 为html标记定义自定义css样式
- 自定义CSS复选框jQuery诱导的“;“已检查”;属性不't在视觉上”;“检查”;复选框
- wordpress主页上的自定义css和js
- 在条件中的几个时间行中设置自定义css效果后,从Jquery时间选择器显示时间
- 圆环饼图中数据标签的自定义CSS类
- CodeMirror在粘贴自定义css线条高度时呈现错误
- 自定义CSS输入框,使页面按ENTER键刷新
- 将自定义CSS注入WP Admin登录弹出iframe
- 如何将jQueryUI与我的自定义css一起使用
- 更改自定义css复选框的大小
- jQuery - 如果提交的表单为空,则添加自定义 css 类
- 将自定义 css 类添加到 ExtJS 4.0.7 面板标头
- 将自定义 CSS 类添加到由 kendoEditor 的工具栏操作触发的弹出窗口中
- 用户配置文件自定义 css