问题
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!
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.
回答1:
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(); };
},
回答2:
I believe you are correct. To load new data, try this:
TreeStore.removeAll();
TreeStore.add(newData);
来源:https://stackoverflow.com/questions/6737806/how-to-update-the-nested-list-tree-store-in-sencha-touch