PDA

View Full Version : Issue in TreePanel?Can anybody help me


sureshbusyboy
05-29-2008, 08:21 AM
Hi,

I am new to extjs.I have an issue in Tree panel.Actually I have a Treepanel created and it is loading data from one php file.But when rendered in html file,I couldnt load the data and not tree is not displayed.
Here i have my code.Could anybody give me the solution.I guess problem is only with the Treeloader.Is there any other option for laoding the data into tree?

My Code for TreePanel:
var TreeTest = function(){

var Tree = Ext.tree;

return {
init : function(){

var tree = new Tree.TreePanel({
el:'tree',
animate:true,
autoScroll:true,
loader: new Tree.TreeLoader({dataUrl:'mynodes.php'}),
enableDD:true,
containerScroll: true,
dropConfig: {appendOnly:true}
});


new Tree.TreeSorter(tree, {folderSort:true});


var root = new Tree.AsyncTreeNode({
text: 'Ext JS',
draggable:false, // disable root node dragging
id:'source'
});
tree.setRootNode(root);


tree.render('tree');

root.expand(false, /*no anim*/ false);

Ext.EventManager.onDocumentReady(TreeTest.init, TreeTest, true);
}