-<html>\r
-<head>\r
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \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"><div id="cls-Ext.form.Action"></div>/**
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <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">/*!
+ * Ext JS Library 3.2.0
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+<div id="cls-Ext.form.Action"></div>/**
* @class Ext.form.Action
* <p>The subclasses of this class provide actions to perform upon {@link Ext.form.BasicForm Form}s.</p>
* <p>Instances of this class are only created by a {@link Ext.form.BasicForm Form} when
* during the time the action is being processed.
*/
+<div id="cfg-Ext.form.Action-submitEmptyText"></div>/**
+ * @cfg {Boolean} submitEmptyText If set to <tt>true</tt>, the emptyText value will be sent with the form
+ * when it is submitted. Defaults to <tt>true</tt>.
+ */
+
<div id="prop-Ext.form.Action-type"></div>/**
* The type of action this Action instance performs.
* Currently only "submit" and "load" are supported.
// private
run : function(){
- var o = this.options;
- var method = this.getMethod();
- var isGet = method == 'GET';
+ var o = this.options,
+ method = this.getMethod(),
+ isGet = method == 'GET';
if(o.clientValidation === false || this.form.isValid()){
+ if (o.submitEmptyText === false) {
+ var fields = this.form.items,
+ emptyFields = [];
+ fields.each(function(f) {
+ if (f.el.getValue() == f.emptyText) {
+ emptyFields.push(f);
+ f.el.dom.value = "";
+ }
+ });
+ }
Ext.Ajax.request(Ext.apply(this.createCallback(o), {
form:this.form.el.dom,
url:this.getUrl(isGet),
params:!isGet ? this.getParams() : null,
isUpload: this.form.fileUpload
}));
+ if (o.submitEmptyText === false) {
+ Ext.each(emptyFields, function(f) {
+ if (f.applyEmptyText) {
+ f.applyEmptyText();
+ }
+ });
+ }
}else if (o.clientValidation !== false){ // client validation failed
this.failureType = Ext.form.Action.CLIENT_INVALID;
this.form.afterAction(this, false);
this.result = result;
return result;
},
-
+
success : function(response, trans){
if(trans.type == Ext.Direct.exceptions.SERVER){
response = {};
this.result = result;
return result;
},
-
+
success : function(response, trans){
if(trans.type == Ext.Direct.exceptions.SERVER){
response = {};
'directload' : Ext.form.Action.DirectLoad,
'directsubmit' : Ext.form.Action.DirectSubmit
};
-</pre> \r
-</body>\r
+</pre>
+</body>
</html>
\ No newline at end of file