一个下拉树的简单实现,ext2.2
var comboxWithTree = new Ext.form.ComboBox({
hiddenName:'consCode',fieldLabel:'建设单位',
displayField:'code',valueField:'value',mode:'local',
store:new Ext.data.SimpleStore({fields:[],data:[[]]}),
editable:false,
shadow:false,
triggerAction:'all',
maxHeight: 200,
tpl:"<div style='height:200px'><div id='tree1'></div></div>",
selectedClass:'',
onSelect:Ext.emptyFn
});
var tree1 = new Ext.tree.TreePanel({
border : false,
rootVisible : false,
root : new Ext.tree.AsyncTreeNode(),
loader : new Ext.tree.TreeLoader({
dataUrl : contextPath+'/build/company.ext?pmethod=getConstructTree'
})
});
tree1.on('click',function(node){
});
comboxWithTree.on('expand',function(){
tree1.render('tree1');
});
?