PDA

View Full Version : Treepanel expandnode issue



funwithextjs
28 Oct 2013, 12:51 PM
Hi,

I have a treepanel (check and extjs 3.2) with expandnode listener to dynamically add child nodes under the selected node. When i expand the node, call is happening but the treeloader is loading from root instead childnodes under the node. here is the code:

xtype:'treepanel',
id:'tree_panel_id',
height: 340,
useArrows:true,
autoScroll:true,
animate:true,
enableDD:true,
containerScroll: true,
rootVisible: false,
iconCls:'.x-tree-node-icon',
frame: true,
root: { nodeType: 'async' }
// auto create TreeLoader
,dataUrl: url
,listeners: {
'expandnode':function(node) {
if(node.getDepth() == 2) {
var treePanelLoader = Ext.getCmp('tree_panel_id').getLoader();
treePanelLoader.dataUrl = url;
treePanelLoader.load(node);
node.expand();
}
}

Help me on how to fix this.

slemmon
30 Oct 2013, 1:11 PM
Would you be able to provide a stand-alone test case including a snippet of the data you're passing back in the response to the loader?