我正在尝试开始对Sencha4Tree面板进行主题化,改变诸如文本大小和背景颜色等内容。我还没有找到正确的方法来做到这一点,使用viewConfig或其他。这是我目前所拥有的:
JS:
var store = Ext.create('Ext.data.TreeStore', {
root: {
expanded: true,
children: [
{ text: "detention", leaf: true },
{ text: "homework", expanded: true, children: [
{ text: "book report", leaf: true },
{ text: "alegrbra", leaf: true}
] },
{ text: "buy lottery tickets", leaf: true }
]
}
});
Ext.create('Ext.tree.Panel', {
title: 'Simple Tree',
width: 400,
height: 250,
store: store,
rootVisible: false,
renderTo: 'nav'
});
HTML:
<div id='nav'>
</div>
CSS:
#nav .x-tree-node-text {
font-size: 1.3em;
background-color: #c0c0c0;
}
http://jsfiddle.net/EzLmd/1/
谁能指出做这件事的正确方法?
发布于 2014-04-01 10:02:53
是的,出于主题的目的,你可以使用相同的技巧来设计不同的ext对象。例如,更改您可以使用的节点的文本颜色。
#nav .x-grid-cell-inner{
color: #ff0000;
}
如果想要全局更改,请不要使用#标签。(在您的应用程序中更改extjs的整个主题)。
了解更多的样式
#nav .x-grid-cell-inner{
color: #ff0000;
text-decoration : line-through;
font-size:larger;
}
希望这能有所帮助;)
https://stackoverflow.com/questions/22752445
复制相似问题