Greetings again,
How do I get (to set properties) a child from a collapsed node in a Ext.tree.TreePanel without expanding the node ? If I don't expand it the tree.getNodeByID returns "null or not an object".
TYA
Greetings again,
How do I get (to set properties) a child from a collapsed node in a Ext.tree.TreePanel without expanding the node ? If I don't expand it the tree.getNodeByID returns "null or not an object".
TYA
If the node's children are loaded from a configured children Array, use preloadChildren: true in the config of the TreeLoader.
If the node's children are to be loaded from the server ask the TreeLoader to load them: http://extjs.com/deploy/dev/docs/?cl...er&member=load
I guess something like:
should work, but no. I'm using a personalized tree loader (found on the web under the name of JayrockTreeLoader), but I don't think that would interfere with this statement, as the only thing my tree loader analyses is the node's ID.Code:tree.getLoader().load(new Ext.tree.AsyncTreeNode({ id: gsel.get('id') }), function() { rsel.removeChild(tree.getNodeById(gsel.get('id'))); } );
Thank you for your quick reply!
load() loads the children of an existing node. So you call it on the node who's child nodes you wish to access.
Obviously unless they are already loaded - you only need to load them once.
Karma can you post your solution here.Because my json file on tree loaded everytime and I could not handle with using id. I want you to see your code
For example, setting a node's text before it has been shown on tree
thenodetoload is the parent node of the node with id='the wanted node's id'. I couldn't understand your problem. If you post some of your 'problem zone' I might be able to help you further.Code:tree.getLoader().load(thenodetoload, function() { tree.getNodeById('the wanted node's id').setText('some text'); });
Is there not an easy way to tell the tree to just load all node/children data during the initialization of the tree ?
I have a tree which *all* initialization data is sent from the server so the entire tree should have all the nodes from square one. However until all the children nodes have been expanded at least once i cannot access the children.
for example:
Code:loader: new Ext.tree.TreeLoader({ preloadChildren: true, dataUrl: '/ica/icaMessenger.HeartBeat.php?cmd=SYN' }),
and data sent from server :
You can see by the node data above that the 'online' list is expanded upon render and the offline is closed.Code:[{ id: "icaMessengerGroup-Online", username: "1", text: "Online (4)", leaf: false, expanded: true, singleClickExpand: true, children: [ { "id": "icaMessenger-1181", text: "xtd1234", leaf: true, iconCls: "ux-Online" }, { "id": "icaMessenger-1133", text: "keckeroo", leaf: true, iconCls: "ux-Online" } ]}, { id: "icaMessengerGroup-Offline", text: "Offline (11)", leaf: false, expanded: false, singleClickExpand: true, children: [ { "id": "icaMessenger-1161", text: "Simpleboxers", leaf: true, iconCls: "ux-Offline" }, { "id": "icaMessenger-1180", text: "Sparkey", leaf: true, iconCls: "ux-Offline" }, { "id": "icaMessenger-1197", text: "chuffy", leaf: true, iconCls: "ux-Offline" }]}]
Unfortunately i want to be able to access the 'offline' children even if the node has not been expanded......
Yeah - i'm kinda stuck here ....
Thanks!
Kevin
It should load them all. Try stepping through with the debugger to see why it's not.