I have a problem with TreeSphere ExtJS 4.0.7. I would like to load a complete tree from a JSON request. The query returns the following:
{ "data": { "children": [ { "text": "OS", "leaf": false, "children": [ { "text": "Hostname", "leaf": false, "children": [ { "text": "hostname.int.com", "leaf": true, "children": [] } ] } ] } ] } }
If it does not work with the following store configuration (or any other that I tried)
Ext.define('My.store.SysInfo', { extend: 'Ext.data.TreeStore', model: 'My.model.SysInfo', proxy : { type : 'ajax', url : '/sysinfo/getSysInfo.php', reader : { root : 'data' } } });
The model has the following code:
Ext.define('My.model.SysInfo', { extend: 'Ext.data.Model', fields: ['text'] });
When adding a tree with this configuration, it does not work:
{ xtype: 'treepanel', name : 'sysinfo', height: '100%', store: 'My.store.SysInfo', lines: true, autoScroll : true, expanded : true, rootVisible: false, folderSort: true, multiSelect: false, useArrows: true, }
When opening a node, ExtJS always loads the entire tree from it root node into subnode, requesting it via ajax, instead of displaying preloaded data. How can I achieve to load the "Hostname" node by opening the "OS"?