- 浏览: 156809 次
- 性别:
- 来自: 河南郑州
-
文章分类
最新评论
-
tianhandigeng:
我用的是Exjts4.2 也不行呢 说没dom这个属性
ext grid刷新后 滚动条位置不变 -
379548695:
extjs4可以试试这个代码checkbox.getEl(). ...
extjs checkbox 动态设置BoxLabel 以及 选中状态 -
-惜帅-:
var comboBoxTree = new Ext.ux. ...
extjs 3.4下拉树扩展 -
-惜帅-:
哇哦,支持了,找了好久,经测试确实有效哈,谢谢分享!使用如下: ...
extjs 3.4下拉树扩展 -
379548695:
feifeiyang 写道地图key申请下了,放到原先的地图里 ...
20120227更新googlemap v2版地图密钥申请
根据[Ext 3.x + Ext 2.x] 下拉树 Ext.ux.ComboBoxTree文章最后2个人反馈点击+号展开节点时列表框消失的情况自己体验了下。确实有这个现象,应该是3.x的有这个问题,2.x正常,现在修改代码如下解决这个问题
ie8,firefox,chrom测试正常,extjs 版本3.4
Ext.ux.ComboBoxTree = function(){ this.treeId = Ext.id()+'-tree'; this.maxHeight = arguments[0].maxHeight || arguments[0].height || this.maxHeight; this.tpl = new Ext.Template('<tpl for="."><div style="height:'+this.maxHeight+'px"><div id="'+this.treeId+'"></div></div></tpl>'); this.store = new Ext.data.SimpleStore({fields:[],data:[[]]}); this.selectedClass = ''; this.mode = 'local'; this.triggerAction = 'all'; this.onSelect = Ext.emptyFn; this.editable = false; this.beforeBlur = Ext.emptyFn; //all:所有结点都可选中 //exceptRoot:除根结点,其它结点都可选(默认) //folder:只有目录(非叶子和非根结点)可选 //leaf:只有叶子结点可选 this.selectNodeModel = arguments[0].selectNodeModel || 'exceptRoot'; this.addEvents('afterchange'); Ext.ux.ComboBoxTree.superclass.constructor.apply(this, arguments); } Ext.extend(Ext.ux.ComboBoxTree,Ext.form.ComboBox, { expand : function(){ Ext.ux.ComboBoxTree.superclass.expand.call(this); if(this.tree.rendered){ return; } Ext.apply(this.tree,{height:this.maxHeight, width:(this.listWidth||this.width-(Ext.isIE?3:0))-2, border:false, autoScroll:true}); if(this.tree.xtype){ this.tree = Ext.ComponentMgr.create(this.tree, this.tree.xtype); } this.tree.render(this.treeId); var root = this.tree.getRootNode(); if(!root.isLoaded()) root.reload(); this.tree.on('click',function(node){ var selModel = this.selectNodeModel; var isLeaf = node.isLeaf(); if((node == root) && selModel != 'all'){ return; }else if(selModel=='folder' && isLeaf){ return; }else if(selModel=='leaf' && !isLeaf){ return; } var oldNode = this.getNode(); if(this.fireEvent('beforeselect', this, node, oldNode) !== false) { this.setValue(node); this.collapse(); this.fireEvent('select', this, node, oldNode); (oldNode !== node) ? this.fireEvent('afterchange', this, node, oldNode) : ''; } }, this); }, setValue : function(node){ this.node = node; var text = node.text; this.lastSelectionText = text; if(this.hiddenField){ this.hiddenField.value = node.id; } Ext.form.ComboBox.superclass.setValue.call(this, text); this.value = node.id; }, getValue : function(){ return typeof this.value != 'undefined' ? this.value : ''; }, getNode : function(){ return this.node; }, clearValue : function(){ Ext.ux.ComboBoxTree.superclass.clearValue.call(this); this.node = null; }, // 重写onViewClick,使展开树结点是不关闭下拉框 onViewClick : function(doFocus) { var index = this.view.getSelectedIndexes()[0], s = this.store, r = s.getAt(index); if (r) { this.onSelect(r, index); } if (doFocus !== false) { this.el.focus(); } }, // private destroy: function() { Ext.ux.ComboBoxTree.superclass.destroy.call(this); Ext.destroy([this.node,this.tree]); delete this.node; } }); Ext.reg('combotree', Ext.ux.ComboBoxTree);
评论
2 楼
-惜帅-
2012-09-04
var comboBoxTree = new Ext.ux.ComboBoxTree({ renderTo : 'EserverTypeID', width : 250, //listWidth:300, 这是设置下拉框的宽度,默认和comBoxTree的宽度相等 tree : new Ext.tree.TreePanel({ bbar: ['业务类型:',{xtype:'trigger',width:200,triggerClass:'x-form-search-trigger',}], loader: new Ext.tree.TreeLoader({dataUrl:'organization!queryDeptTreeJSON.json'}), root : new Ext.tree.AsyncTreeNode({id:'0',text:'根结点'}) }), selectNodeModel:'leaf', //只有选叶子时,才设置值 listeners:{ beforeselect: function(comboxtree,newNode,oldNode){//选择树结点设值之前的事件 //... }, select: function(comboxtree,newNode,oldNode){//选择树结点设值之后的事件 //... }, afterchange: function(comboxtree,newNode,oldNode){//选择树结点设值之后,并当新值和旧值不相等时的事件 //... } } });
1 楼
-惜帅-
2012-09-04
哇哦,支持了,找了好久,经测试确实有效哈,谢谢分享!
使用如下:方便后来者
使用如下:方便后来者
var comboBoxTree = new Ext.ux.ComboBoxTree({ renderTo : 'EserverTypeID', width : 250, //listWidth:300, 这是设置下拉框的宽度,默认和comBoxTree的宽度相等 tree : new Ext.tree.TreePanel({ bbar: ['业务类型:',{xtype:'trigger',width:200,triggerClass:'x-form-search-trigger',}], loader: new Ext.tree.TreeLoader({dataUrl:'organization!queryDeptTreeJSON.json'}), root : new Ext.tree.AsyncTreeNode({id:'0',text:'根结点'}) }), selectNodeModel:'leaf', //只有选叶子时,才设置值 listeners:{ beforeselect: function(comboxtree,newNode,oldNode){//选择树结点设值之前的事件 //... }, select: function(comboxtree,newNode,oldNode){//选择树结点设值之后的事件 //... }, afterchange: function(comboxtree,newNode,oldNode){//选择树结点设值之后,并当新值和旧值不相等时的事件 //... } } });
发表评论
-
RowExpander和checkbox同时使用时出现错位
2013-03-28 15:48 1131添加如下代码 var expander = new ... -
Extjs 查找FormPanel(也包括所有容器)下的所有子组件
2013-01-31 11:19 2282一.items数组 (推荐)Extjs API 没有相关说明 ... -
extjs checkbox 动态设置BoxLabel 以及 选中状态
2013-01-14 11:16 9871Ext.override(Ext.form.Checkbo ... -
extjs tab的圆角改为方角
2013-01-04 15:55 1900加载时更改的CSS,你可以写在CSS文件中,如下 ... -
Extjs3.4 双击标题关闭tab页
2012-11-14 09:08 2149参考的http://atian25.javaeye.com/b ... -
extjs checkboxtree添加全选全不选功能
2012-05-09 08:42 7283先上效果图 tbar : [{ x ... -
extjs中通过tpl实现带图标的ComboBox
2012-03-16 11:22 1725下拉框选择图片列表 详见:http://blog ... -
Extjs Combobox中显示两个字段内容
2012-03-16 11:20 1844字段1 字段2 字段3cnbj 中国 北京c ... -
淘宝用的 js压缩混淆工具
2011-09-16 16:04 1694安装指南 ========= 安装步骤: 1. ... -
extjs textfield 添加tooltip或者其他的提示信息
2011-09-08 11:44 4315/** * {xtype : "uxTextFi ... -
extjs ColumnModel renderer 的参数
2011-09-07 09:39 857renderer:function(value, cel ... -
extjs grid的根据数据动态给checkbox赋值
2011-09-07 09:35 2717直接给grid的列添加renderer即可,代码如下: ... -
extjs grid的Ext.grid.CheckboxSelectionModel默认选中解决方法
2011-09-07 09:23 7239grid的复选框定义如下: var sm = ... -
复制extjs grid表格数据
2011-07-14 11:15 1344本文来自CSDN博客,转载请标明出处:http://blog. ... -
ext grid刷新后 滚动条位置不变
2010-08-13 15:35 4732在实时刷新的时候数据量过大会出现滚动条。这时候需要记录滚动条的 ... -
extjs combox只读的解决办法
2010-01-22 11:59 1799加入如下代码: onTriggerClick : Ext. ... -
ext笔记
2009-10-22 16:05 12121.ext事件封装在ext.lib.Event下。上一层还有e ... -
将ext中的FormPanel中,所有组件都居中放置
2009-10-22 15:36 4580再Ext.form.FormPanel加入如下属性值 b ... -
extjs grid设置某列背景颜色
2009-01-09 19:19 8293效果 css代码 .x-grid-back-red ... -
extjs grid设置某行字体颜色
2009-01-09 13:39 12333效果 css代码 .x-grid-record-red ...
相关推荐
在EXTJS框架中,"多选下拉框"(Multi-Select ComboBox)是一种常见的组件,它允许用户在下拉列表中选择多个选项。EXTJS 3.*版本也提供了这种功能,使得开发者能够创建功能丰富的界面,提升用户体验。下面将详细解释...
#### 五、扩展阅读 - **响应式设计**:使导航栏在不同设备上均能良好展示。 - **框架和库**:了解Bootstrap、jQuery等工具如何简化导航栏的创建过程。 - **前端框架集成**:Vue.js、React等前端框架中如何实现复杂的...
首先,我们来看看`LovCombo.js`,这可能是一个自定义的组合框组件,扩展了ExtJS的原生ComboBox类,以实现多选功能。在ExtJS中,创建这样的组件通常涉及到以下步骤: 1. **创建一个新的类**:定义一个继承自Ext.form...
在ExtJS 3.4中,LovCombo通常由`Ext.form.ComboBox`类扩展而来,它提供了一个下拉框,用户可以在其中选择一个或多个值。然而,原生的ComboBox并不直接支持全选和取消全选的功能。为了实现这个功能,我们需要自定义...
**3.4 自定义消息框** - **特点**: 可以自定义样式、按钮等。 - **示例**: 使用 `Ext.MessageBox.show()` 方法自定义弹窗。 #### 四、页面与脚本完全分离 **4.1 Extjs 是脚本的世界** - **概念**: Extjs 支持将 ...
在Ext3.4版本中,IconCombobox是对Combobox的增强,它允许每个列表项前面添加一个图标。这在许多场景下都很有用,例如,当需要区分不同类型的选项时,图标可以提供视觉上的辅助信息。实现这个功能通常需要自定义...
7.5.11 树节点:ext.data.nodeinterface与ext.data.tree / 364 7.5.12 store的方法 / 366 7.5.13 store的事件 / 368 7.5.14 store管理器:ext.data.storemanager / 369 7.6 综合实例 / 369 7.6.1 远程读取json...