/*!
- * 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
*/
-/*\r
- * Ext JS Library 2.2\r
- * Copyright(c) 2006-2008, Ext JS, LLC.\r
- * licensing@extjs.com\r
- * \r
- * http://extjs.com/license\r
- */\r
-\r
/**
* @class Ext.ux.ValidationStatus
* A {@link Ext.StatusBar} plugin that provides automatic error notification when the
* @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 <tt>'x-status-error'</tt>.
+ */
errorIconCls : 'x-status-error',
-
+ /**
+ * @cfg {String} errorListCls
+ * The css class to be used for the error list when there are validation errors.
+ * Defaults to <tt>'x-status-error-list'</tt>.
+ */
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 <tt>'x-status-valid'</tt>.
+ */
validIconCls : 'x-status-valid',
+ /**
+ * @cfg {String} showText
+ * The {@link #text} value to be applied when there is a form validation error.
+ * Defaults to <tt>'The form has errors (click for details...)'</tt>.
+ */
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 <tt>'Click again to hide the error list'</tt>.
+ */
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 <tt>'Saving...'</tt>.
+ */
submitText : 'Saving...',
// private
}, this);
var startMonitor = function(){
this.monitor = true;
- }
+ };
this.form.on('actioncomplete', startMonitor, this);
this.form.on('actionfailed', startMonitor, this);
}
- }, this, {single:true});\r
- sb.on('afterlayout', function(){\r
- // Grab the statusEl after the first layout.\r
- sb.statusEl.getEl().on('click', this.onStatusClick, this, {buffer:200});\r
- }, 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
// 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
},
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);