如何在Sencha Touch中更新嵌套列表/树存储? [英] How to update the Nested List/Tree Store in Sencha Touch?
本文介绍了如何在Sencha Touch中更新嵌套列表/树存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个嵌套列表,必须根据用户在Ext.Carousel中选择的内容填充新数据.
I have a nested list which must be filled with new data based on what does user select in an Ext.Carousel.
TreeStore.load(newData) // this does not work :(
TreeStore.removeAll() // this works!
似乎文档和论坛都没有答案,因为我已经搜索了2-3天.预先谢谢你.
It seems that the docs and the forum don't have the answer, cause I have been searching for 2-3 days. Thank you in advance.
推荐答案
我最终得到了以下解决方案:
I've ended up with following solution:
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(); };
},
这篇关于如何在Sencha Touch中更新嵌套列表/树存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文