/*

 * Ext JS Library 2.1

 * Copyright(c) 2006-2008, Ext JS, LLC.

 * licensing@extjs.com

 * 

 * http://extjs.com/license

 */



Ext.onReady(function(){

    // shorthand

    var Tree = Ext.tree;

    

    var tree = new Tree.TreePanel({

        el:'tree-div',

        useArrows:true,

        autoScroll:true,

        animate:true,

        enableDD:true,

        containerScroll: true, 

        loader: new Tree.TreeLoader({

            dataUrl:'get-nodes.php'

        })

    });



    // set the root node

    var root = new Tree.AsyncTreeNode({

        text: 'Ext JS',

        draggable:false,

        id:'source'

    });

    tree.setRootNode(root);



    // render the tree

    tree.render();

    root.expand();

});