aria-tree.js
上传用户:dawnssy
上传日期:2022-08-06
资源大小:9345k
文件大小:1k
源码类别:

JavaScript

开发平台:

JavaScript

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