My question is: How can I load the TreeStore at once?
Because right now, if I'm using proxy, to get Tree after rendering, when I expand the leaf, there is one more request with GET parameter 'node'
- the id of leaf node. So I need to response with the tree of this leaf. but I want to load ALL tree at once and no more requests for that tree.
Right now I have below code:
Ext.define('AdminPanel.TreeNavigation', {
extend: 'Ext.data.Model',
fields: ['id', 'text', 'leaf', 'children']
});
var store = Ext.create('Ext.data.TreeStore', {
model: 'AdminPanel.TreeNavigation',
proxy: {
type: 'ajax',
url : 'admin/getTreeNav',
reader: {
type: 'json',
root: 'result'
}
},
root: {
expanded: true
}
});