【问题标题】:ExtJs 5: TreePanel: Not getting the default leaf icons and linesExtJs 5:TreePanel:没有得到默认的叶子图标和线条
【发布时间】:2014-06-11 13:37:16
【问题描述】:

我使用 Sencha ExtJs 5 创建了一个示例 TreePanel。 我按照文档中的示例示例进行操作,可以看到项目(叶子和树枝),但它们不是作为树出现,而是作为列表出现。

这是我的代码:

商店:

Ext.define('MyApp.store.ResourcesStore', {
extend : 'Ext.data.TreeStore',
root : {
    expanded : true,
    children : [ {
        text : "UI Forms",
        leaf: false,
        expanded : true,
        children : [ {
            text : "Web",
            leaf : true
        }, {
            text : "Smart Phone",
            leaf : true
        }, {
            text : "Tablet",
            leaf : true
        }, ]
    }, {
        text : "Reports",
        leaf : true
    }, {
        text : "Dashboards",
        leaf : true
    }, {
        text : "Entities",
        leaf : true
    }, {
        text : "Queries",
        leaf : true
    }, {
        text : "Services",
        leaf : true
    } ]
}
});

查看:

Ext.define('MyApp.view.leftpanel.ResourcesView', {
extend : 'Ext.TreePanel',
xtype : 'resources-panel',
title : 'Resources',
store : 'ResourcesStore',
rootVisible : false
});

这是我的输出的样子:

执行sencha app build命令后: 手风琴面板受到影响。

【问题讨论】:

    标签: javascript extjs extjs5 treepanel


    【解决方案1】:

    如果您使用 Sencha Cmd,那么您很可能需要:

    sencha app refresh
    sencha ant sass
    

    如果没有帮助,那么

    sencha app build
    

    应用程序引导程序需要知道您正在使用树,以便知道要加载哪个 css。

    【讨论】:

    • 虽然我使用sencha generate app 命令创建了默认应用程序,但我现在使用 Eclipse 将它集成到一个动态 Web 项目中。并在eclipse中做进一步的开发。你能告诉我应该在哪里运行这些命令吗?我不断收到此错误 - "[ERR] Command must be run from an application folder"
    • 在 index.html 所在的目录中运行命令 - 最初创建应用程序的位置。
    • 好的,我做到了,得到了树结构。感谢那。但是现在我这样做后有一个新问题。手风琴面板的图标搞砸了。它们不再是我之前的那些了。
    • 请看上面添加的图片以支持我之前的评论。
    • 在开发过程中查看是否有任何“同步加载”警告。修复所有这些并重建。
    【解决方案2】:

    我有类似的问题,发现只需停止“Sencha app watch”并重新启动它即可解决。

    【讨论】:

      【解决方案3】:

      我也是,图标不显示,它看起来像一个列表。就我而言,sencha 应用程序构建不起作用。但是我使用了sencha app watch,图标出现了。我想我的版本'Sencha Cmd v5.1.2.52'的sencha cmd一定有问题,watch cmd工作是因为它有助于添加sass 我需要。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2013-07-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-11-27
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多