How to reload Ext.tree.TreePanel on demand?
- by Sergei Stolyarov
I want to create Ext.tree.TreePanel component and periodically load content from the external URl. So I've written something like
new Ext.tree.TreePanel({
root: {
nodeType: 'async',
text: 'asdasd',
draggable: false,
id: 'folders-tree-root'
},
loader: new Ext.tree.TreeLoader()
});
And now I want to reload this tree, so I write:
tree.loader.dataUrl = 'folders-sample.json';
tree.root.reload();
And nothing happens.
add:
The only way I've found is set some invalid value to dataUrl param on TreeLoader creation:
new Ext.tree.TreePanel({
root: {
nodeType: 'async',
text: 'asdasd',
draggable: false,
id: 'folders-tree-root'
},
loader: new Ext.tree.TreeLoader(dataUrl: 'something')
});