- 浏览: 462310 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
njliukang:
请问一下,如果是异步树,应该怎么解决?貌似用expandpat ...
ExtJS Tree刷新后自动展开并选择节点 -
xiaoyueyue5721:
这是ScriptDataSet,如果换成OdaDataSet呢 ...
Birt动态填充DataSet数据 -
leexiaodong2009:
我准备要用那个锁定。
ExtJS 3.0 优秀扩展简介 (持续更新) -
babyhhcsy:
pizza823 写道分享下另外中方法store里面不用变在列 ...
ExtJS EditorGridPanel中时间日期编辑问题的总结 -
冷月宫主:
高手,请问一下有没有使用Ext做过多表头锁定左侧指定列的处理? ...
仅供纪念,曾做过的一些界面截图
2010-07-08补充:
DateField隐藏的解决方案,详见本文底部.
2010-07-04补充:
ExtJS3.2的combo文档中更新的一种新的解决方案,详见本文底部.
续前文: http://atian25.iteye.com/blog/431545
上篇只解决了combo下拉框被遮盖的问题,但是如果选择como的某项,或者点击下拉菜单就会自动隐藏menu,如下图.
初步猜测是该item的点击被判断不属于menu的范围,所以隐藏掉了.
翻了半天的源码,终于找到此句:
// Ext.menu.MenuMgr function onMouseDown(e){ if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){ hideAll(); } }
觉得应该是这个class的问题,于是给combo加个样式就搞定了,如下源码:
var combo = new Ext.form.ComboBox({ fieldLabel: '修复后的Combo', store: data, mode: 'local', triggerAction:'all', /* * 关键点 * 1. x-menu使combo在选择的时候不会隐藏掉menu,看Ext.menu.MenuMgr.onMouseDown源码即知 * 2. x-menu里面的"z-index: 15000;",因为menu里面的layer的z-index是15000,则这里大于15000即可.. * 3.因为这个cls已经有个z-index,所以前文中我们自定义的那个class可以去掉了 */ listClass:' x-menu ' });
完整的测试代码和截图如下:
Ext.onReady(function(){ Ext.BLANK_IMAGE_URL = '/images/s.gif'; Ext.QuickTips.init(); fixMenuBug() }); function fixMenuBug(){ //Defined combo var data = []; for(var i=0;i<20;i++){ data.push('option'+i); } var combo = new Ext.form.ComboBox({ fieldLabel: '修复后的Combo', store: data, mode: 'local', triggerAction:'all', /* * 关键点 * 1. x-menu使combo在选择的时候不会隐藏掉menu,看Ext.menu.MenuMgr.onMouseDown源码即知 * 2. x-menu里面的"z-index: 15000;",因为menu里面的layer的z-index是15000,则这里大于15000即可.. */ listClass:' x-menu ' }); var bugcombo = new Ext.form.ComboBox({ fieldLabel: '菜单被遮盖住的Combo', store: data, mode: 'local', triggerAction:'all', listClass:'' }); var bugcombo2 = new Ext.form.ComboBox({ fieldLabel: '点击下拉滚动条/选择子项会隐藏的Combo', store: data, mode: 'local', triggerAction:'all', listClass:' comboInMenu ' }); var combo2 = new Ext.form.ComboBox({ fieldLabel: 'fixedCombo2', store: ['选我,不隐藏'].concat(data), value:'选我,不隐藏', mode: 'local', triggerAction:'all', listClass:' x-menu ' }); var noHideText=new Ext.form.TextField({ value: '点我,不会被隐藏', //关键点:让组件被选中的时候不隐藏掉menu hideOnClick:false }); var hideText=new Ext.form.TextField({ value: '点我,隐藏' }); var form = new Ext.FormPanel({ labelWidth: 250, frame:true, width: 550, height:150, items: [ {xtype:'textfield',fieldLabel:'输入框'}, bugcombo, bugcombo2, combo ], buttons: [{text: 'Save'},{text: 'Cancel'}] }); var btn = new Ext.SplitButton({ renderTo: document.body, text: 'Options', menu: new Ext.menu.Menu({ items: [ form,combo2,noHideText,hideText, /* 2.2版本中需要对Adapter的第二个参数中加入hideOnClick:false new Ext.menu.Adapter(form,{hideOnClick:false}), new Ext.menu.Adapter(combo2,{hideOnClick:false}), new Ext.menu.Adapter(noHideText), new Ext.menu.Adapter(hideText), */ {text:'点击我,不隐藏',hideOnClick:false}, {text:'点击我,2.0隐藏,3.0不隐藏'} ] }) }); }
2010-07-08 更新:
DateField隐藏的解决方法:
因为DF里面还有个datemenu,所以需要设置该属性allowOtherMenus: true
var dateField = new Ext.form.DateField({ fieldLabel:'日期1', menu: new Ext.menu.DateMenu({ hideOnClick: false, allowOtherMenus: true }) })
2010-07-04 更新:
ExtJS 3.2.0 文档中提到的一种解决方法:
getListParent() : void ComboBox Returns the element used to house this ComboBox's pop-up list. Defaults to the document body. A custom implementation... Returns the element used to house this ComboBox's pop-up list. Defaults to the document body. A custom implementation may be provided as a configuration option if the floating list needs to be rendered to a different Element. An example might be rendering the list inside a Menu so that clicking the list does not hide the Menu: var store = new Ext.data.ArrayStore({ autoDestroy: true, fields: ['initials', 'fullname'], data : [ ['FF', 'Fred Flintstone'], ['BR', 'Barney Rubble'] ] }); var combo = new Ext.form.ComboBox({ store: store, displayField: 'fullname', emptyText: 'Select a name...', forceSelection: true, getListParent: function() { return this.el.up('.x-menu'); }, iconCls: 'no-icon', //use iconCls if placing within menu to shift to right side of menu mode: 'local', selectOnFocus: true, triggerAction: 'all', typeAhead: true, width: 135 }); var menu = new Ext.menu.Menu({ id: 'mainMenu', items: [ combo // A Field in a Menu ] });
评论
4 楼
kingdy13
2010-02-17
问题解决了,饮水思源,特地完成测试后来这回复,感谢高手的分享。
3 楼
yy67906927
2010-01-15
晕了,3.1中下拉还是会被挡住.
2 楼
atian25
2010-01-14
菜鸟的弟弟 写道
太感谢啦~~~
最近我也出现这个问题,正愁找不到方法呢。
另:请问如何看Ext.menu.MenuMgr中的代码啊,我怎么在3.0的api中找不到。。。
本人还在学习中,请见谅。
最近我也出现这个问题,正愁找不到方法呢。
另:请问如何看Ext.menu.MenuMgr中的代码啊,我怎么在3.0的api中找不到。。。
本人还在学习中,请见谅。
ext-3.0.0\src\widgets\menu\MenuMgr.js
1 楼
菜鸟的弟弟
2010-01-13
太感谢啦~~~
最近我也出现这个问题,正愁找不到方法呢。
另:请问如何看Ext.menu.MenuMgr中的代码啊,我怎么在3.0的api中找不到。。。
本人还在学习中,请见谅。
最近我也出现这个问题,正愁找不到方法呢。
另:请问如何看Ext.menu.MenuMgr中的代码啊,我怎么在3.0的api中找不到。。。
本人还在学习中,请见谅。
发表评论
-
[4.x] Ext.ux.button.AutoRefresher
2011-05-23 11:22 2667/** * @class Ext.ux.b ... -
ExtJS 4.x 定制你的js
2011-05-01 00:04 0... -
ExtJS4.x 随笔(2011-04-29更新)
2011-04-29 13:41 36931.某个激活/禁用的checkboxfield,需要提交后台的 ... -
ExtJS 4.0 改善Ext.grid.plugin.RowEditing (重构,v1.4版本,2011-09-11)
2011-04-27 15:24 12520Ext4.0 自带的Ext.ux.RowEditing还不够完 ... -
ExtJS Tree刷新后自动展开并选择节点
2010-07-29 10:48 17619很久没写EXTJS的tip了... 今天帮组员写了一个 ... -
仅供纪念,曾做过的一些界面截图
2010-07-06 16:55 3368仅供记录用. 1.亚运(EXTJS) ... -
ExtJS3.x 随笔(2010-07-08更新)
2010-07-02 17:15 3517谨用该贴来记录一些使 ... -
Ext JS 3.2.0发布 -- 不少令人振奋的特性(更新翻译后的release-notes)
2010-04-01 15:02 3722不少令人振奋的新功能 1.form里面的复合组件 ---写 ... -
ExtJS EditorGridPanel中时间日期编辑问题的总结
2009-09-23 09:48 10130老是被反复问到这个问题,烦了...总结下... 1.首 ... -
Ext 3.0.1 Release Notes
2009-08-31 07:58 3916难熬的三天....JE终于恢复了.... 可惜要付费 ... -
也谈谈Ext.Grid之记录用户使用习惯—隐藏列
2009-08-27 15:58 7545在论坛看到http://www.iteye ... -
ExtJS 常见问题 - by tz
2009-08-14 16:13 0经常在群里面被问到的一些问题,不如汇集起来算了... ... -
ExtJS 3.0 优秀扩展简介 (持续更新)
2009-08-14 10:14 17174自带示例里面的扩展就 ... -
ExtJS 2.3/3.0 定制你所需要的模块
2009-08-12 13:49 13217很实在的一个需求,就是 ... -
ExtJS Combo 下拉列表正常显示HTML标签内容
2009-08-11 15:02 5856解决问题: http://www.iteye.com/pro ... -
ExtJS 3.0 Designer Preview (官方的IDE可视化工具)
2009-08-11 12:35 24633原文地址: http://extjs.com/blog/200 ... -
ExtJS 输入框/MessageBox.prompt 禁止粘贴
2009-07-30 13:33 6731回答问题http://www.iteye.com/proble ... -
ExtJS 修复3.0里面的LovCombo(下拉多选框)的Bug
2009-07-27 16:16 11279如果你不知道lovcombo是什么,看http://setti ... -
续:ExtJS Chart 扩展(重构了下,并写了个新的示例--内存监控)
2009-07-27 15:55 5890续前文:http://atian25.iteye.com/bl ... -
ExtJS Chart 扩展 - 增加对数据的过滤等操作
2009-07-24 17:41 911609.07.27 , 重构了下,详见:http://atia ...
相关推荐
xtype : 'jxcombo' //配置项 jxValueField:要获取值得字段名称,默认null //公共方法 getJXValue():返回自定义字段的值,如果没有自定义字段,则等价Ext.form.Combo类的getValue()方法
可以动态的新增和删除Ext控件,这里支持的上传控件的新增和删除。
因为extjs的bug(3月30如果选择2月将自动变成3月)。所以需要修改monthField中safeParse方法: else if ("Y-m"==format) { // set time to 12 noon, then clear the time var parsedDate = Date.parseDate(value + ...
extjs6 datetimefield 时间 增加分时秒控件
extjs4.2 分页combo动态条数 源码,不懂的加群
extjs自定义控件extjs自定义控件extjs自定义控件extjs自定义控件extjs自定义控件extjs自定义控件extjs自定义控件
extjs 6 的日期时间控件,不能用我铲脸
extjs 时间控件
extjs扩展年度控件,EXTJS里的时间控件的年度重写
使用ExtJs的DataView扩展的Tags控件,使用时将Tags.js和tags.css导入页面,将tags文件也放进工程,实例化Tags类即可使用,类的配置项有注释说明。
NULL 博文链接:https://xiaomy.iteye.com/blog/2331789
Extjs DateField控件 - 只选择年份(找了很久发现网上只有选择年月的控件,于是基于extjs年月控件设计了只选择年份的控件)
适用于ext3.2、3.3,打开index.html即可见效果
extjs ip控件 extjs ip控件 extjs ip控件 extjs ip控件 extjs ip控件
extjs时间空间精确秒
extjs 微调控件,时间微调控件,微调,javascript 微调 v2.0以上都可以用!!!
extjs是一个多文件上传的控件。可以实现多文件上传。
ExtJs图片按钮控件:设置文字、文字颜色、背景图片、是否可用
ExtJs的页面布局、界面设计的源码 直接运行index.html可看效果,源码在里面
ExtJS是一套完整的RIA解决方案,也因为功能完整造成了ext-all.js有400多k,由于是基于JS和CSS的功能实现,对客户端机器性能也有一定的要求,即不支持IE6以下的版本。如果您的项目对网页响应时间有严格的限制,或者...