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 work开发者_如何学Pythons!
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(); };
},
I believe you are correct. To load new data, try this:
TreeStore.removeAll();
TreeStore.add(newData);
精彩评论