如题:怎么在ComboBox的下拉框中加入DhtmlXTree树形控件
tree.js
Ext.onReady(function(){
tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);
tree.setImagePath("codebase/imgs/"); //提明树图标路径
tree.setEscapingMode("utf8");//设置url编码格式为utf-8
tree.enableDragAndDrop(0); //是否允许拖放0/1 允许/不允许
tree.enableTreeLines(false);//是否显示TreeLines 初始化
tree.setImageArrays("plus","","","","plus.gif");//set plus images设置收缩节点图标
tree.setImageArrays("minus","","","","minus.gif"); //set minus images设置展开节点图标
tree.enableTreeLines(true),
//tree.enableAutoTooltips(1);//设置tree的提示,提示内容为item的text
//tree.setStdImages("book.gif","books_open.gif","books_close.gif");
// tree.setXMLAutoLoading("test4.xml");
//tree.loadXML("test4.xml");
//tree.enableCheckBoxes(1);//是否显示复选框 0/1 不显示/显示
// tree.enableThreeStateCheckboxes(3);//允许三种状态的复选框(全选/不选/部分选中)
//tree.insertNewItem(parentId,itemId,itemText,itemActionHandler,image1,image2,image3,optionStr,childs)
tree.insertNewItem(0,1,'区域管理','','','','','','');
tree.insertNewChild(1,2,'北京');
tree.insertNewChild(1,3,'天津');
tree.insertNewChild(1,4,'上海');
tree.insertNewChild(1,5,'湖南');
tree.insertNewChild(1,6,'广西');
tree.insertNewChild(4,7,'徐家汇');
tree.insertNewChild(4,8,'百老会');
tree.insertNewChild(4,9,'不清楚');
tree.insertNewChild(4,10,'哈哈哈');
tree.setOnClickHandler(test);
function test(){
var text= tree.getSelectedItemText();
alert(text);
}
var user_combobox = new Ext.form.ComboBox({
store: new Ext.data.SimpleStore({fields:[],data:[[]]}),
id: 'person_combobox',
//hiddenName: 'parent_group',
readOnly: true,
editable:false, //禁止手写及联想功能
fieldLabel: '所属部门',
emptyText: '请选择部门',
blankText: '请选择用户所属部门',
allowBlank: false,
validateOnBlur: true,
mode: 'local',
triggerAction: 'all',
anchor: '90%',
tpl: '
resizable: true,
renderTo:"a1"
})
})
我用 tpl: '