Ext.TreeComboflh = Ext.extend(Ext.form.ComboBox, {
??initList : function() {
???this.list = new Ext.tree.TreePanel({
????autoScroll : true,
????resizable : true,
????rootVisible : false,
????root : new Ext.tree.AsyncTreeNode({
???????id : '',
???????text : '根节点'
??????}),
????loader : new Ext.tree.TreeLoader({
?????dataUrl :?this.dataUrl
?????????}),
????floating : true,
????height : 300,
????width : 80,
????listeners : {
?????click : this.onNodeClick,
?????scope : this
????},
????alignTo : function(el, pos) {
?????this.setPagePosition(this.el.getAlignToXY(el, pos));
????}
???});
??},
??expand : function() {
???if (!this.list.rendered) {
????this.list.render(document.body);
????this.list.setWidth(this.el.getWidth());
????this.innerList = this.list.body;
????this.list.hide();
???}
???this.el.focus();
???Ext.TreeComboflh.superclass.expand.apply(this, arguments);
??},
??doQuery : function(q, forceAll) {
???this.expand();
??},
??collapseIf : function(e) {
???if (!e.within(this.wrap) && !e.within(this.list.el)) {
????this.collapse();
???}
??},
??onNodeClick : function(node, e) {
???if (node.attributes.description != null
?????&& node.attributes.description != '') {
????this.setValue(node.attributes.description);
????this.setRawValue(node.attributes.text);
???} else {
????this.setValue(node.id);
????this.setRawValue(node.attributes.text);
???}
???this.collapse();
??}
?});
?Ext.reg('treecomboflh', Ext.TreeComboflh);
详细解决方案
扩展combo上拉树
热度:113 发布时间:2012-11-01 11:11:31.0
相关解决方案
- .关于EXTJS combo 下拉树的有关问题
- Easyui - combo[tree,box]下拉图标有间隙bug解决办法
- How to get dispayfield in extjs combo
- EXTJS editorgrid combo render有关问题
- sexy combo 数据量大的时分好慢
- Ext combo 上拉框级联
- Ext Combo 平添空值并且显示出来
- Ext 2.x combo keyup事件没法响应
- ExtJs 中 combo 取得displayField 和 valueField
- 在 ExtJs 中实现上拉列表(combo)联动
- 拼音输入法上输入字母Ext combo
- ExtJS Combo box Store 加载两次有关问题
- ExtJS4除了下拉框的光标(remove the cursor of combo)
- combo box控件收起下拉后,遮挡了其他控件解决思路
- jquery.combo.select.js下拉框筛选
- Combo box的使用
- Combo Cleaner for Mac(Mac系统清理)破解版
- 思维/差分: Perform the Combo
- easyUI combo textbox datebox 默认高度问题