PDA

View Full Version : Need Help for TreePanel Loading



sam.arulprakash
10 Feb 2011, 10:59 PM
Hi All,

Not able to load my TreeLoader Dynamically.

But I am in need to load tree panel after button click. I dont find "autoLoad" property in TreePanel.




var param1=new Object();
param1.strLocationCodeOrName="";
param1.strLocationType="";

PhrsTree1 = new Ext.tree.TreePanel
({
loader:new XMLTreeLoader(),
root: new Ext.tree.AsyncTreeNode
({
text: 'RootNode',
code:'RootNode' ,
id: 'RootNode',
expanded: true,
leaf: false,
draggable: true
}),
Load:function()
{
PhrsTree1.getLoader().requestMethod ="POST"
PhrsTree1.getLoader().dataUrl = 'wrapper.asmx/ReturnXML';
PhrsTree1.getLoader().baseParams=param1;
PhrsTree1.getLoader().load(PhrsTree1.getRootNode());
PhrsTree1.getRootNode().reload();
PhrsTree1.getRootNode().expand();
},
renderTo:document.body
});

PhrsTree1.Load();


But this code works, when I have configured the loader like this,



loader: new XMLTreeLoader
({
dataUrl:''wrapper.asmx/ReturnXML',
requestMethod: 'POST',
baseParams:param1
})


Please post your suggestion.

Thanks,
Arul Prakash