source: trunk/web/addons/job_monarch/lib/extjs-30/examples/tree/aria-tree.js @ 625

Last change on this file since 625 was 625, checked in by ramonb, 15 years ago

lib/extjs-30:

  • new ExtJS 3.0
File size: 1.3 KB
Line 
1/*!
2 * Ext JS Library 3.0.0
3 * Copyright(c) 2006-2009 Ext JS, LLC
4 * licensing@extjs.com
5 * http://www.extjs.com/license
6 */
7var TreeTest = function(){
8    // shorthand
9    var Tree = Ext.tree;
10
11    return {
12        init : function(){
13            // yui-ext tree
14            var tree = new Tree.TreePanel({
15                animate:true,
16                autoScroll:true,
17                loader: new Tree.TreeLoader({dataUrl:'get-nodes.php'}),
18                containerScroll: true,
19                border: false,
20                height: 300,
21                width: 300
22            });
23
24            // add a tree sorter in folder mode
25            new Tree.TreeSorter(tree, {folderSort:true});
26
27            // set the root node
28            var root = new Tree.AsyncTreeNode({
29                text: 'Ext JS',
30                draggable:false, // disable root node dragging
31                id:'src'
32            });
33            tree.setRootNode(root);
34
35            // render the tree
36            tree.render('tree');
37            root.expand(false, /*no anim*/ false);
38            tree.bodyFocus.fi.setFrameEl(tree.el);
39            tree.getSelectionModel().select(tree.getRootNode());
40            tree.enter.defer(100, tree);
41        }
42    };
43}();
44
45Ext.EventManager.onDocumentReady(TreeTest.init, TreeTest, true);
Note: See TracBrowser for help on using the repository browser.