日期:2014-05-16 浏览次数:20457 次
var comboxWithTree = new Ext.form.ComboBox({ store : new Ext.data.SimpleStore({ fields : [], data : [[]] }), id : 'comboxWithTree', emptyText : '请输入拼音,如北京,输入bj,或从列表选择', width : 250, fieldLabel : "请选择", mode : 'local', triggerAction : 'all', selectedClass : '', enableKeyEvents : true, onSelect : Ext.emptyFn, listeners:{ 'keyup' : function(){ setNull(); searchText = comboxWithTree.getValue(); } } }); var root = new Ext.tree.AsyncTreeNode(); var tree = new Ext.tree.TreePanel({ height : 300, width : 250, autoScroll : true, animate : true, containerScroll : true, rootVisible : false, border : false, allowUnLeafClick : true, root : root, loader : new Ext.tree.TreeLoader({ dataUrl : 'xxxxxxxxxxxxxx', baseParams : { //此处不方便展示 } }) }); comboxWithTree.on('beforeRender', function() { comboxWithTree.tpl = "<div id='" + randomid + "' ><div>"; }); comboxWithTree.on('expand', function() { tree.render("" + randomid + ""); });