【问题标题】:How to load tree store form ajax response如何加载树存储表单ajax响应
【发布时间】:2018-07-20 23:00:46
【问题描述】:

我在ExtJS 中定义了我的树代码。我在treepanel 定义中声明了我的store

这是我的代码。

{
    xtype: 'treepanel',
    useArrows: true,
    autoScroll: false,
    animate: true,
    animateShadow: true,
    enableDD: false,
    id: 'myTreePanel',
    rootVisible: false,
    store: Ext.create('Ext.data.TreeStore', {
        root: {
            expanded: true,
            children: [],
        }
    })
}

从回复中,我得到了这样的数据。谁能帮我在ExtJS Tree 面板中加载数据。

myTreeData = [{
    children: [],
    text: 'text1'
}, {
    children: [],
    text: 'text2'
}, {
    children: [{
        children: null,
        text: 'text31'
    }, {
        children: null,
        text: 'text32'
    }],
    text: 'text3'
}, {
    children: [],
    text: 'text4'
}, {
    children: [],
    text: 'text5'
}]

【问题讨论】:

    标签: extjs extjs6


    【解决方案1】:

    你应该使用store.setRootNode(myTreeData)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-15
      • 2014-05-24
      • 1970-01-01
      • 2020-02-17
      • 2013-04-16
      • 2012-02-17
      • 1970-01-01
      • 2011-11-01
      相关资源
      最近更新 更多