Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / examples / tree / two-trees.js
1 Ext.require(['*']);
2
3 Ext.onReady(function(){
4     var store = Ext.create('Ext.data.TreeStore', {
5         proxy: {
6             type: 'ajax',
7             url: 'get-nodes.php'
8         },
9         root: {
10             text: 'Ext JS',
11             id: 'src',
12             expanded: true
13         },
14         folderSort: true,
15         sorters: [{
16             property: 'text',
17             direction: 'ASC'
18         }]
19     });
20
21     var tree = Ext.create('Ext.tree.Panel', {
22         id: 'tree',
23         store: store,
24         width: 250,
25         height: 300,
26         viewConfig: {
27             plugins: {
28                 ptype: 'treeviewdragdrop',
29                 appendOnly: true
30             }
31         },
32         renderTo: document.body
33     });
34
35     var store2 = Ext.create('Ext.data.TreeStore', {
36         proxy: {
37             type: 'ajax',
38             url: 'get-nodes.php'
39         },
40         root: {
41             text: 'Custom Ext JS',
42             id: 'src',
43             expanded: true,
44             children: []
45         },
46         folderSort: true,
47         sorters: [{
48             property: 'text',
49             direction: 'ASC'
50         }]
51     });
52
53     var tree2 = Ext.create('Ext.tree.Panel', {
54         id: 'tree2',
55         width: 250,
56         height: 300,
57         store: store2,
58         viewConfig: {
59             plugins: {
60                 ptype: 'treeviewdragdrop',
61                 appendOnly: true
62             }
63         },
64         renderTo: document.body
65     });
66 });