X-Git-Url: http://git.roojs.org/?p=roojs1;a=blobdiff_plain;f=docs%2Fsrc%2FRoo_form_TextField.js.html;fp=docs%2Fsrc%2FRoo_form_TextField.js.html;h=a2d24d153b6aaf28ecb7a3be1b85a5a54ff56866;hp=4aad7895cfa540072671d7e0eadba469dd8cac8b;hb=9c024aa0d7e78ad1630dca48384ef6586cd374d4;hpb=d25b2a59660233bd4af2b7c68dcdb508dd3b7727 diff --git a/docs/src/Roo_form_TextField.js.html b/docs/src/Roo_form_TextField.js.html index 4aad7895cf..a2d24d153b 100644 --- a/docs/src/Roo_form_TextField.js.html +++ b/docs/src/Roo_form_TextField.js.html @@ -1,4 +1,4 @@ -/home/edward/gitlive/roojs1/Roo/form/TextField.js/* +Roo/form/TextField.js/* * Based on: * Ext JS Library 1.1.1 * Copyright(c) 2006-2007, Ext JS, LLC. @@ -83,6 +83,10 @@ * @cfg {Boolean} selectOnFocus True to automatically select any existing field text when the field receives input focus (defaults to false) */ selectOnFocus : false, + /** + * @cfg {Boolean} allowLeadingSpace True to prevent the stripping of leading white space + */ + allowLeadingSpace : false, /** * @cfg {String} blankText Error text to display if the allow blank validation fails (defaults to "This field is required") */ @@ -127,8 +131,11 @@ if(this.selectOnFocus){ this.on("focus", this.preFocus, this); - } + if (!this.allowLeadingSpace) { + this.on('blur', this.cleanLeadingSpace, this); + } + if(this.maskRe || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Roo.form.VTypes[this.vtype+'Mask']))){ this.el.on("keypress", this.filterKeys, this); } @@ -164,7 +171,15 @@ this.autoSize(); } }, + // private - clean the leading white space + cleanLeadingSpace : function(e) + { + if ( this.inputType == 'file') { + return; + } + this.setValue((this.getValue() + '').replace(/^\s+/,'')); + }, /** * Resets the current field value to the originally-loaded value and clears any validation messages. * @@ -173,8 +188,6 @@ Roo.form.TextField.superclass.reset.call(this); }, - - // private preFocus : function(){