Tree 如何更新Sencha Touch中的嵌套列表/树存储?

Tree 如何更新Sencha Touch中的嵌套列表/树存储?,tree,sencha-touch,api-design,nested-lists,Tree,Sencha Touch,Api Design,Nested Lists,我有一个嵌套列表,必须根据用户在Ext.Carousel中选择的内容填充新数据 TreeStore.load(newData) // this does not work :( TreeStore.removeAll() // this works! 似乎文档和论坛都没有答案,因为我已经搜索了2-3天了。提前谢谢你。我相信你是对的。要加载新数据,请尝试以下操作: TreeStore.removeAll(); TreeStore.add(newData); 我最终得到了以下解决方案: Nest

我有一个嵌套列表,必须根据用户在Ext.Carousel中选择的内容填充新数据

TreeStore.load(newData) // this does not work :(
TreeStore.removeAll() // this works!

似乎文档和论坛都没有答案,因为我已经搜索了2-3天了。提前谢谢你。

我相信你是对的。要加载新数据,请尝试以下操作:

TreeStore.removeAll();
TreeStore.add(newData);

我最终得到了以下解决方案:

NestedList = Ext.extend(Ext.NestedList, {
    loadData: function(data) {
        this.store.setProxy({
            type:'memory',
            data: data,
            reader: {
                type: 'tree',
                root: 'items'
            }
        });
        this.store.load();
        { // some back taps to make it show the top level
            this.onBackTap();         
            this.onBackTap();         
            this.onBackTap(); }; 
},

添加()不存在带有内存代理的setProxy/load组合工作得非常好!