Upgrade to ExtJS 3.1.0 - Released 12/16/2009
[extjs.git] / examples / tree / two-trees.js
index f6672ec..9c3219b 100644 (file)
@@ -1,11 +1,9 @@
-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
+/*!
+ * 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
 var TreeTest = function(){\r
     // shorthand\r
     var Tree = Ext.tree;\r
@@ -14,12 +12,14 @@ var TreeTest = function(){
         init : function(){\r
             // yui-ext tree\r
             var tree = new Tree.TreePanel({\r
         init : function(){\r
             // yui-ext tree\r
             var tree = new Tree.TreePanel({\r
-                el:'tree',\r
                 animate:true, \r
                 autoScroll:true,\r
                 loader: new Tree.TreeLoader({dataUrl:'get-nodes.php'}),\r
                 enableDD:true,\r
                 containerScroll: true,\r
                 animate:true, \r
                 autoScroll:true,\r
                 loader: new Tree.TreeLoader({dataUrl:'get-nodes.php'}),\r
                 enableDD:true,\r
                 containerScroll: true,\r
+                border: false,\r
+                width: 250,\r
+                height: 300,\r
                 dropConfig: {appendOnly:true}\r
             });\r
             \r
                 dropConfig: {appendOnly:true}\r
             });\r
             \r
@@ -30,28 +30,30 @@ var TreeTest = function(){
             var root = new Tree.AsyncTreeNode({\r
                 text: 'Ext JS', \r
                 draggable:false, // disable root node dragging\r
             var root = new Tree.AsyncTreeNode({\r
                 text: 'Ext JS', \r
                 draggable:false, // disable root node dragging\r
-                id:'source'\r
+                id:'src'\r
             });\r
             tree.setRootNode(root);\r
             \r
             // render the tree\r
             });\r
             tree.setRootNode(root);\r
             \r
             // render the tree\r
-            tree.render();\r
+            tree.render('tree');\r
             \r
             root.expand(false, /*no anim*/ false);\r
             \r
             //-------------------------------------------------------------\r
             \r
             \r
             root.expand(false, /*no anim*/ false);\r
             \r
             //-------------------------------------------------------------\r
             \r
-            // YUI tree            \r
+            // ExtJS tree            \r
             var tree2 = new Tree.TreePanel({\r
             var tree2 = new Tree.TreePanel({\r
-                el:'tree2',\r
                 animate:true,\r
                 autoScroll:true,\r
                 //rootVisible: false,\r
                 loader: new Ext.tree.TreeLoader({\r
                     dataUrl:'get-nodes.php',\r
                 animate:true,\r
                 autoScroll:true,\r
                 //rootVisible: false,\r
                 loader: new Ext.tree.TreeLoader({\r
                     dataUrl:'get-nodes.php',\r
-                    baseParams: {lib:'yui'} // custom http params\r
+                    baseParams: {path:'extjs'} // custom http params\r
                 }),\r
                 containerScroll: true,\r
                 }),\r
                 containerScroll: true,\r
+                border: false,\r
+                width: 250,\r
+                height: 300,\r
                 enableDD:true,\r
                 dropConfig: {appendOnly:true}\r
             });\r
                 enableDD:true,\r
                 dropConfig: {appendOnly:true}\r
             });\r
@@ -61,12 +63,12 @@ var TreeTest = function(){
             \r
             // add the root node\r
             var root2 = new Tree.AsyncTreeNode({\r
             \r
             // add the root node\r
             var root2 = new Tree.AsyncTreeNode({\r
-                text: 'My Files', \r
+                text: 'Extensions', \r
                 draggable:false, \r
                 draggable:false, \r
-                id:'yui'\r
+                id:'ux'\r
             });\r
             tree2.setRootNode(root2);\r
             });\r
             tree2.setRootNode(root2);\r
-            tree2.render();\r
+            tree2.render('tree2');\r
             \r
             root2.expand(false, /*no anim*/ false);\r
         }\r
             \r
             root2.expand(false, /*no anim*/ false);\r
         }\r