initial import
[roojs1] / examples / tree / coltree.js
1 /*
2  * Based on:
3  * Ext JS Library 1.1.1
4  * Copyright(c) 2006-2007, Ext JS, LLC.
5  *
6  * Originally Released Under LGPL - original licence link has changed is not relivant.
7  *
8  * Fork - LGPL
9  * <script type="text/javascript">
10  */
11
12  var tree = false; 
13  
14 Roo.onReady(function(){
15     // shorthand
16     var Tree = Roo.tree;
17     
18     tree = new Tree.ColumnTree('tree-div', {
19    // tree = new Tree.TreePanel('tree-div', {
20         animate:true, 
21         loader: new Tree.TreeLoader({
22            dataUrl:'get-nodes.php?uiProvider=col',
23            //dataUrl:'get-nodes.php',
24             uiProviders: {
25                 col: Roo.tree.ColumnNodeUI
26             }
27         }),
28         enableDD:true,
29         containerScroll: true,
30         
31        width: 550,
32       height: 300,
33       rootVisible:false,
34       autoScroll:true,
35       title: 'Example ',
36         
37         columns:[{
38             header:'Task',
39             width:330,
40             dataIndex:'task'
41         },{
42             header:'Type',
43             width:100,
44             dataIndex:'cls'
45         },{
46             header:'Size',
47             width:100,
48             dataIndex:'size'
49         }],
50   
51         
52         
53         
54     });
55
56     // set the root node
57     var root = new Tree.AsyncTreeNode({
58         text: 'Ext JS',
59         draggable:true,
60         id:'source'
61     });
62     tree.setRootNode(root);
63
64     // render the tree
65     tree.render();
66     root.expand();
67 });