var comboxWithTree = new Ext.form.ComboBox({
fieldLabel:"使用科室",
hiddenName:'entity.cuseDept',
store:new Ext.data.SimpleStore({fields:[],data:[[]]}),
editable:false,
mode: 'local',
triggerAction:'all',
maxHeight: 200,
tpl: "<tpl for='.'><div style='height:200px'><div id='tree'></div></div></tpl>",
selectedClass:'',
onSelect:Ext.emptyFn
});
var tree = new Ext.tree.TreePanel({
containerScroll: true,//是否支持滚动条
rootVisible:false,//是否显示跟节点
loader:new Ext.tree.TreeLoader({
dataUrl:'base/department!getTree.action'
}) ,
root:new Ext.tree.AsyncTreeNode({
text:'root',
draggable:false,//是否可以拖拽
id:'-1'
})
});
tree.on('click',function(node){
comboxWithTree.setValue(node.text);
comboxWithTree.collapse();
});
comboxWithTree.on('expand',function(){
tree.render('tree');
});
Ext 树形的下拉框
最新推荐文章于 2021-03-17 08:49:57 发布