Reputation: 53
I have and application that uses NestedList with a TreeStore. TreeStore is using AJAX type proxy and XML reader. Now I have implemented Settings page, where you can change the URL that is used as a data source. Application needs to "reload" after that change. As a result, I change proxy URL:
App.tree_store.proxy.url = new_url;
Then I would like to load a new data:
App.tree_store.load();
When I switch NestedList to root card, it will contain mixed data from previous configuration and current one:
App.views.hdTreeView.setActiveItem(0);
Question: How should I "clear/reset" NestedList before loading entirely new data (same data model)? Do I have to clear TreeStore / SubStores and Proxy as well, if yes, how? Maybe using destroy() method and recreate new components?
If I remove all lists using removeAll() and than reload store, new list will not be created.
Thanks!
Upvotes: 0
Views: 1580
Reputation: 11
showDetail: function(list, index , element , record) {
//Take your store
var store = Ext.getStore('yourstore');
//Apply the params
Ext.apply(store.getProxy()._extraParams, {
id : record.data.id
});
//Reload your store
store.load();
}
put this code at controller
just change extraParams
to fetch new data.
in store dont input exterparam
.
so u cab use just one url but chnage just param for fetch data.
Upvotes: 1
Reputation: 2974
First use store.setProxy()
and pass new proxy object then use this:
nestedListObject.bindStore(store.load());
where the nestedListObject
is your nested list.
Upvotes: 0