I have a simple TreePanel. I would like to select a specific node at boot time. Nodes from a remote file (json).
The tree is loading as expected. However, node is not selectable. Firebug shows node as undefined. This is possible due to the async property. But I cannot configure this other wise or specify node.
Any suggestions are welcome and thanks.
LeftMenuTree = new Ext.tree.TreePanel({ renderTo: 'TreeMenu', collapsible: false, height: 450, border: false, userArrows: true, animate: true, autoScroll: true, id: 'testtest', dataUrl: fileName, root: { nodeType: 'async', iconCls:'home-icon', expanded:true, text: rootText }, listeners: { "click": { fn: onPoseClick, scope: this } }, "afterrender": { fn: setNode, scope: this } }); function setNode(){ alert (SelectedNode); if (SelectedNode == "Orders"){ var treepanel = Ext.getCmp('testtest'); var node = treepanel.getNodeById("PendingItems"); node.select(); } }
source share