3

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

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

似乎文档和论坛没有答案,因为我已经搜索了 2-3 天。先感谢您。

4

2 回答 2

4

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

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(); }; 
},
于 2011-07-19T16:55:24.487 回答
-3

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

TreeStore.removeAll();
TreeStore.add(newData);
于 2011-07-19T14:07:53.680 回答