X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..0494b8d9b9bb03ab6c22b34dae81261e3cd7e3e6:/docs/source/Editor.html diff --git a/docs/source/Editor.html b/docs/source/Editor.html index b9852b67..7abd20a3 100644 --- a/docs/source/Editor.html +++ b/docs/source/Editor.html @@ -1,15 +1,16 @@ + The source code
/*!
- * Ext JS Library 3.0.3
- * 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 @@ -39,8 +40,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, @@ -71,6 +73,11 @@ Ext.extend(Ext.Editor, Ext.Component, { * The position to align to (see {@link Ext.Element#alignTo} for more details, defaults to "c-c?"). */ alignment: "c-c?", +
/** + * @cfg {Array} offsets + * The offsets to use when aligning (see {@link Ext.Element#alignTo} for more details. Defaults to [0, 0]. + */ + offsets: [0, 0],
/** * @cfg {Boolean/String} shadow "sides" for sides/bottom only, "frame" for 4-way shadow, and "drop" * for bottom-right shadow (defaults to "frame") @@ -204,7 +211,7 @@ Ext.extend(Ext.Editor, Ext.Component, { this.cancelEdit(); } if(field.triggerBlur){ - field.triggerBlur(); + field.triggerBlur(); } } this.fireEvent('specialkey', field, e); @@ -227,9 +234,9 @@ Ext.extend(Ext.Editor, Ext.Component, { } if(this.fireEvent("beforestartedit", this, this.boundEl, v) !== false){ this.startValue = v; + this.field.reset(); this.field.setValue(v); - this.doAutoSize(); - this.el.alignTo(this.boundEl, this.alignment); + this.realign(true); this.editing = true; this.show(); } @@ -266,7 +273,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); } @@ -276,9 +284,13 @@ Ext.extend(Ext.Editor, Ext.Component, {
/** * Realigns the editor to the bound field based on the current alignment config value. + * @param {Boolean} autoSize (optional) True to size the field to the dimensions of the bound element. */ - realign : function(){ - this.el.alignTo(this.boundEl, this.alignment); + realign : function(autoSize){ + if(autoSize === true){ + this.doAutoSize(); + } + this.el.alignTo(this.boundEl, this.alignment, this.offsets); },
/** @@ -289,6 +301,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){ @@ -334,7 +350,7 @@ Ext.extend(Ext.Editor, Ext.Component, { this.fireEvent("canceledit", this, v, this.startValue); } }, - + // private hideEdit: function(remainVisible){ if(remainVisible !== true){ @@ -345,7 +361,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(); } }, @@ -383,10 +400,13 @@ Ext.extend(Ext.Editor, Ext.Component, { }, beforeDestroy : function(){ - Ext.destroy(this.field); - this.field = null; + Ext.destroyMembers(this, 'field'); + + delete this.parentEl; + delete this.boundEl; } }); -Ext.reg('editor', Ext.Editor);
+Ext.reg('editor', Ext.Editor); + \ No newline at end of file