X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/6e39d509471fe9b4e2660e0d1631b350d0c66f40..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/src/widgets/Editor.js diff --git a/src/widgets/Editor.js b/src/widgets/Editor.js index cc475eb6..5d53acdb 100644 --- a/src/widgets/Editor.js +++ b/src/widgets/Editor.js @@ -1,8 +1,8 @@ /*! - * Ext JS Library 3.1.0 - * Copyright(c) 2006-2009 Ext JS, LLC - * licensing@extjs.com - * http://www.extjs.com/license + * Ext JS Library 3.3.1 + * Copyright(c) 2006-2010 Sencha Inc. + * licensing@sencha.com + * http://www.sencha.com/license */ /** * @class Ext.Editor @@ -32,8 +32,9 @@ Ext.extend(Ext.Editor, Ext.Component, { /** * @cfg {Boolean} allowBlur * True to {@link #completeEdit complete the editing process} if in edit mode when the - * field is blurred. Defaults to false. + * field is blurred. Defaults to true. */ + allowBlur: true, /** * @cfg {Boolean/String} autoSize * True for the editor to automatically adopt the size of the underlying field, "width" to adopt the width only, @@ -202,7 +203,7 @@ Ext.extend(Ext.Editor, Ext.Component, { this.cancelEdit(); } if(field.triggerBlur){ - field.triggerBlur(); + field.triggerBlur(); } } this.fireEvent('specialkey', field, e); @@ -264,7 +265,8 @@ Ext.extend(Ext.Editor, Ext.Component, { delete this.field.lastSize; this.field.setSize(w, h); if(this.el){ - if(Ext.isGecko2 || Ext.isOpera){ + // IE7 in strict mode doesn't size properly. + if(Ext.isGecko2 || Ext.isOpera || (Ext.isIE7 && Ext.isStrict)){ // prevent layer scrollbars this.el.setSize(w, h); } @@ -291,6 +293,10 @@ Ext.extend(Ext.Editor, Ext.Component, { if(!this.editing){ return; } + // Assert combo values first + if (this.field.assertValue) { + this.field.assertValue(); + } var v = this.getValue(); if(!this.field.isValid()){ if(this.revertInvalid !== false){ @@ -336,7 +342,7 @@ Ext.extend(Ext.Editor, Ext.Component, { this.fireEvent("canceledit", this, v, this.startValue); } }, - + // private hideEdit: function(remainVisible){ if(remainVisible !== true){ @@ -347,7 +353,8 @@ Ext.extend(Ext.Editor, Ext.Component, { // private onBlur : function(){ - if(this.allowBlur !== true && this.editing){ + // selectSameEditor flag allows the same editor to be started without onBlur firing on itself + if(this.allowBlur === true && this.editing && this.selectSameEditor !== true){ this.completeEdit(); } }, @@ -386,7 +393,7 @@ Ext.extend(Ext.Editor, Ext.Component, { beforeDestroy : function(){ Ext.destroyMembers(this, 'field'); - + delete this.parentEl; delete this.boundEl; }