2011-07-18 53 views
3

我有一个嵌套列表,必须根据用户在Ext.Carousel中选择的内容填充新数据。如何在Sencha Touch中更新嵌套列表/树存储?

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

看来,文档和论坛上没有答案,因为我一直在寻找2-3天。先谢谢你。

回答

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(); }; 
}, 
+0

与内存代理的setProxy /荷载组合工作完全好! –

-3

我相信你是对的。要加载新的数据,试试这个:

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

TreeStore.add()不存在 – nnyby

相关问题