X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6a7e4474cba9d8be4b2ec445e10f1691f7277c50..b37ceabb82336ee82757cd32efe353cfab8ec267:/src/widgets/form/Combo.js diff --git a/src/widgets/form/Combo.js b/src/widgets/form/Combo.js index c1ec8ee3..87b89fc4 100644 --- a/src/widgets/form/Combo.js +++ b/src/widgets/form/Combo.js @@ -1,5 +1,5 @@ /*! - * Ext JS Library 3.2.0 + * Ext JS Library 3.2.2 * Copyright(c) 2006-2010 Ext JS, Inc. * licensing@extjs.com * http://www.extjs.com/license @@ -524,24 +524,28 @@ var combo = new Ext.form.ComboBox({ } return zindex; }, + + getZIndex : function(listParent){ + listParent = listParent || Ext.getDom(this.getListParent() || Ext.getBody()); + var zindex = parseInt(Ext.fly(listParent).getStyle('z-index'), 10); + if(!zindex){ + zindex = this.getParentZIndex(); + } + return (zindex || 12000) + 5; + }, // private initList : function(){ if(!this.list){ var cls = 'x-combo-list', - listParent = Ext.getDom(this.getListParent() || Ext.getBody()), - zindex = parseInt(Ext.fly(listParent).getStyle('z-index'), 10); - - if (!zindex) { - zindex = this.getParentZIndex(); - } + listParent = Ext.getDom(this.getListParent() || Ext.getBody()); this.list = new Ext.Layer({ parentEl: listParent, shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false, - zindex: (zindex || 12000) + 5 + zindex: this.getZIndex(listParent) }); var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth); @@ -743,7 +747,23 @@ var menu = new Ext.menu.Menu({ initEvents : function(){ Ext.form.ComboBox.superclass.initEvents.call(this); - + /** + * @property keyNav + * @type Ext.KeyNav + *

A {@link Ext.KeyNav KeyNav} object which handles navigation keys for this ComboBox. This performs actions + * based on keystrokes typed when the input field is focused.

+ *

After the ComboBox has been rendered, you may override existing navigation key functionality, + * or add your own based upon key names as specified in the {@link Ext.KeyNav KeyNav} class.

+ *

The function is executed in the scope (this reference of the ComboBox. Example:


+myCombo.keyNav.esc = function(e) {  // Override ESC handling function
+    this.collapse();                // Standard behaviour of Ext's ComboBox.
+    this.setValue(this.startValue); // We reset to starting value on ESC
+};
+myCombo.keyNav.tab = function() {   // Override TAB handling function
+    this.onViewClick(false);        // Select the currently highlighted row
+};
+
+ */ this.keyNav = new Ext.KeyNav(this.el, { "up" : function(e){ this.inKeyMode = true; @@ -1282,14 +1302,7 @@ var menu = new Ext.menu.Menu({ this.list.alignTo.apply(this.list, [this.el].concat(this.listAlign)); // zindex can change, re-check it and set it if necessary - var listParent = Ext.getDom(this.getListParent() || Ext.getBody()), - zindex = parseInt(Ext.fly(listParent).getStyle('z-index') ,10); - if (!zindex){ - zindex = this.getParentZIndex(); - } - if (zindex) { - this.list.setZIndex(zindex + 5); - } + this.list.setZIndex(this.getZIndex()); this.list.show(); if(Ext.isGecko2){ this.innerList.setOverflow('auto'); // necessary for FF 2.0/Mac