无聊散文第一集

13年前
(function() {
 on = {
  loadOrgAuch : function(image_url, url, showDiv, showId,showName) {
   Ext.BLANK_IMAGE_URL = image_url;
   var Tree = Ext.tree;
   var tree = new Tree.TreePanel({
      el : showDiv,
      rootVisible : true, // 隐藏根节点
      border : true, // 边框
      animate : true, // 动画效果
      autoScroll : true, // 自动滚动
      enableDD : false, // 拖拽节点
      containerScroll : true,
      useArrows : false,
      width : 200,
      height : 260,
      loader : new Tree.TreeLoader({})
     });
   var root = new Tree.AsyncTreeNode({
      text : '选择',
      draggable : false,
      // 树的根节点的ID设置成0默认加载父亲节点为0的子结点
      id : '0'
     });
   tree.setRootNode(root);
   tree.on('beforeload', function(node) {
      tree.loader.dataUrl = url + node.id
     });
   tree.on('click', function(node) {
      if (node.id != 0) {
       document.getElementById(showId).value = node.id;
       document.getElementById(showName).value = node.text;
       $("#"+showDiv).hide();
      }
     });
   tree.render();
   root.expand();
  }
 }
})();