I want to change my store dynamically. I have extJs tree panel, as item of window.widget. I want to change the store of this panel dynamically. My logic is the following: aJax request is sent to my controller and cotroller return jsonObject. I wont to set this jsonObject which is return by my controller to be a NEW store of my tree panel, and refresh only the tree panel. This is what I have done till now, but dynamically change is not work. Please, keep in mind that my json object which is used for store is created and live in memory. Everything works fine untill new store appears and tree doesn't get the store in a way that I try.
My store:
var store = Ext.create('Ext.data.TreeStore', {
root: {
id: 'rootNode',
expanded: true,
children: childrenParam
}
});
and my treepanel:
xtype: 'treepanel',
region: 'west',
id: 'navigation',
title: 'Tree of builds',
width: "30%",
height: "100%",
layout: 'fit',
rootVisible: false,
store: store,
split: true,
autoScroll: true,
collapsible: true,
floatable: false
...
What I have tried is:
var myPanel = Ext.getCmp('navigation');
myPanel.store.tree.root.childNodes = result;
where result is the json object which is return from mine controller. This json object is fine but changing of store is not working properly.
Thank you in advance for help!