0

使用 Extjs 6.2,我似乎无法在 TreeStore 上编辑节点的大小。

Ext.define('Ext.ux.bnp.menu.ApplicationMenuPluginStore', {
extend : 'Ext.data.TreeStore',
alias : 'store.menustore',
width : 2000, //doesn't work here


fields : [ {
    name : 'text'
} ],
id : 'menustore',

root : {
    expanded : true,

    children : [ {
        text : 'children',
        iconCls : 'fa fa-search',
        rowCls : 'x-treelist-item-selected',
        leaf : true,
        expanded : true,
        checked : true,
        href : '../dummy/dummy.jsp'
        witdh: 2000, //doesn't work here too
    }, 

    {
        text : 'dummy',
        iconCls:'fa fa-book',
        rowCls : 'nav-tree-badge',
        witdh : 2000, //doesn't work here
        selectable : false,
        children : [ 
        {
            text : 'dummy son',
            iconCls : 'fa fa-building',
            href : '../dummy/son.jsp',
            leaf : true
            witdh: 2000, //neither do here
        },

我也尝试使用一些 Css 来改变它:

.x-treelist-item-leaf {
  width          : 2000 !important;
}
.x-treelist-item-wrap {
  width          : 2000 !important;
}

.x-treelist-item {
  width          : 2000 !important;
}

似乎没有任何效果。所以我想知道如何编辑我的 TreeStore 节点的大小。

4

1 回答 1

1

首先,TreeStore 是用于数据管理的,如果你想改变任何关于视图的东西,你必须改变 TreePanel 的属性。其次,节点的宽度将与 TreePanel 的宽度相同(参见小提琴)。如果你想改变节点的高度,那也不是问题:FIDDLE

于 2018-09-17T09:28:28.243 回答