生成树

var comboBoxTree = new Ext.ux.ComboBoxTree({    
      renderTo : 'comboBoxTree',    
      width : 250,    
      //listWidth:300, 这是设置下拉框的宽度,默认和comBoxTree的宽度相等   
      tree : new Ext.tree.TreePanel({    
            bbar: ['名称:',{xtype:'trigger',width:200,triggerClass:'x-form-search-trigger',}],    
            loader: new Ext.tree.TreeLoader({dataUrl:'getNodes.jsp'}),    
            root : new Ext.tree.AsyncTreeNode({id:'0',text:'根结点'})    
      }),   
      selectNodeModel:'leaf', //只有选叶子时,才设置值   
      listeners:{   
            beforeselect: function(comboxtree,newNode,oldNode){//选择树结点设值之前的事件   
                   //...   
            },   
            select: function(comboxtree,newNode,oldNode){//选择树结点设值之后的事件   
                  //...   
            },   
            afterchange: function(comboxtree,newNode,oldNode){//选择树结点设值之后,并当新值和旧值不相等时的事件   
                  //...   
            }   
      }   
}); 

你可能感兴趣的:(jsp,ext)