X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432:/examples/statusbar/ValidationStatus.js..25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775:/examples/ux/statusbar/ValidationStatus.js diff --git a/examples/statusbar/ValidationStatus.js b/examples/ux/statusbar/ValidationStatus.js similarity index 73% rename from examples/statusbar/ValidationStatus.js rename to examples/ux/statusbar/ValidationStatus.js index ff3a803a..83587bfa 100644 --- a/examples/statusbar/ValidationStatus.js +++ b/examples/ux/statusbar/ValidationStatus.js @@ -1,17 +1,9 @@ /*! - * Ext JS Library 3.0.0 + * Ext JS Library 3.0.3 * Copyright(c) 2006-2009 Ext JS, LLC * licensing@extjs.com * http://www.extjs.com/license */ -/* - * Ext JS Library 2.2 - * Copyright(c) 2006-2008, Ext JS, LLC. - * licensing@extjs.com - * - * http://extjs.com/license - */ - /** * @class Ext.ux.ValidationStatus * A {@link Ext.StatusBar} plugin that provides automatic error notification when the @@ -22,17 +14,42 @@ * @param {Object} config A config object */ Ext.ux.ValidationStatus = Ext.extend(Ext.Component, { - + /** + * @cfg {String} errorIconCls + * The {@link #iconCls} value to be applied to the status message when there is a + * validation error. Defaults to 'x-status-error'. + */ errorIconCls : 'x-status-error', - + /** + * @cfg {String} errorListCls + * The css class to be used for the error list when there are validation errors. + * Defaults to 'x-status-error-list'. + */ errorListCls : 'x-status-error-list', - + /** + * @cfg {String} validIconCls + * The {@link #iconCls} value to be applied to the status message when the form + * validates. Defaults to 'x-status-valid'. + */ validIconCls : 'x-status-valid', + /** + * @cfg {String} showText + * The {@link #text} value to be applied when there is a form validation error. + * Defaults to 'The form has errors (click for details...)'. + */ showText : 'The form has errors (click for details...)', - + /** + * @cfg {String} showText + * The {@link #text} value to display when the error list is displayed. + * Defaults to 'Click again to hide the error list'. + */ hideText : 'Click again to hide the error list', - + /** + * @cfg {String} submitText + * The {@link #text} value to be applied when the form is being submitted. + * Defaults to 'Saving...'. + */ submitText : 'Saving...', // private @@ -55,15 +72,25 @@ Ext.ux.ValidationStatus = Ext.extend(Ext.Component, { }, this); var startMonitor = function(){ this.monitor = true; - } + }; this.form.on('actioncomplete', startMonitor, this); this.form.on('actionfailed', startMonitor, this); } - }, this, {single:true}); - sb.on('afterlayout', function(){ - // Grab the statusEl after the first layout. - sb.statusEl.getEl().on('click', this.onStatusClick, this, {buffer:200}); - }, this, {single: true}); + }, this, {single:true}); + sb.on({ + scope: this, + afterlayout:{ + single: true, + fn: function(){ + // Grab the statusEl after the first layout. + sb.statusEl.getEl().on('click', this.onStatusClick, this, {buffer:200}); + } + }, + beforedestroy:{ + single: true, + fn: this.onDestroy + } + }); }, // private @@ -143,7 +170,7 @@ Ext.ux.ValidationStatus = Ext.extend(Ext.Component, { // private showErrors : function(){ this.updateErrorList(); - this.getMsgEl().alignTo(this.statusBar.getEl(), this.listAlign).slideIn('b', {duration:.3, easing:'easeOut'}); + this.getMsgEl().alignTo(this.statusBar.getEl(), this.listAlign).slideIn('b', {duration:0.3, easing:'easeOut'}); this.statusBar.setText(this.hideText); this.form.getEl().on('click', this.hideErrors, this, {single:true}); // hide if the user clicks directly into the form }, @@ -152,7 +179,7 @@ Ext.ux.ValidationStatus = Ext.extend(Ext.Component, { hideErrors : function(){ var el = this.getMsgEl(); if(el.isVisible()){ - el.slideOut('b', {duration:.2, easing:'easeIn'}); + el.slideOut('b', {duration:0.2, easing:'easeIn'}); this.statusBar.setText(this.showText); } this.form.getEl().un('click', this.hideErrors, this);