-/*!
- * Ext JS Library 3.1.0
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-var TreeTest = function(){\r
- // shorthand\r
- var Tree = Ext.tree;\r
-\r
- return {\r
- init : function(){\r
- // yui-ext tree\r
- var tree = new Tree.TreePanel({\r
- animate:true,\r
- autoScroll:true,\r
- loader: new Tree.TreeLoader({dataUrl:'get-nodes.php'}),\r
- containerScroll: true,\r
- border: false,\r
- height: 300,\r
- width: 300\r
- });\r
-\r
- // add a tree sorter in folder mode\r
- new Tree.TreeSorter(tree, {folderSort:true});\r
-\r
- // set the root node\r
- var root = new Tree.AsyncTreeNode({\r
- text: 'Ext JS',\r
- draggable:false, // disable root node dragging\r
- id:'src'\r
- });\r
- tree.setRootNode(root);\r
-\r
- // render the tree\r
- tree.render('tree');\r
- root.expand(false, /*no anim*/ false);\r
- tree.bodyFocus.fi.setFrameEl(tree.el);\r
- tree.getSelectionModel().select(tree.getRootNode());\r
- tree.enter.defer(100, tree);\r
- }\r
- };\r
-}();\r
-\r
-Ext.EventManager.onDocumentReady(TreeTest.init, TreeTest, true);
\ No newline at end of file