-<html>\r
-<head>\r
- <title>The source code</title>\r
- <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
- <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
-</head>\r
-<body onload="prettyPrint();">\r
- <pre class="prettyprint lang-js">/*\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
-<div id="cls-Ext.ux.ValidationStatus"></div>/**
+<html>
+<head>
+ <title>The source code</title>
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
+</head>
+<body onload="prettyPrint();">
+ <pre class="prettyprint lang-js"><div id="cls-Ext.ux.ValidationStatus"></div>/**
* @class Ext.ux.ValidationStatus
* A {@link Ext.StatusBar} plugin that provides automatic error notification when the
* associated form contains validation errors.
* @param {Object} config A config object
*/
Ext.ux.ValidationStatus = Ext.extend(Ext.Component, {
-
+ <div id="cfg-Ext.ux.ValidationStatus-errorIconCls"></div>/**
+ * @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',
-
+ <div id="cfg-Ext.ux.ValidationStatus-errorListCls"></div>/**
+ * @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',
-
+ <div id="cfg-Ext.ux.ValidationStatus-validIconCls"></div>/**
+ * @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',
+ <div id="cfg-Ext.ux.ValidationStatus-showText"></div>/**
+ * @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...)',
-
+ <div id="cfg-Ext.ux.ValidationStatus-showText"></div>/**
+ * @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',
-
+ <div id="cfg-Ext.ux.ValidationStatus-submitText"></div>/**
+ * @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);
this.showErrors();
}
}
-});</pre> \r
-</body>\r
+});</pre>
+</body>
</html>
\ No newline at end of file