X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/2e847cf21b8ab9d15fa167b315ca5b2fa92638fc..c8256059947f3aa8f5b0a9a2acf55e2142bb4742:/docs/source/Action.html diff --git a/docs/source/Action.html b/docs/source/Action.html index 53befa78..155d8be1 100644 --- a/docs/source/Action.html +++ b/docs/source/Action.html @@ -1,12 +1,18 @@ - - - - The source code - - - - -
/** + + + + The source code + + + + +
/*!
+ * Ext JS Library 3.2.1
+ * Copyright(c) 2006-2010 Ext JS, Inc.
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+
/** * @class Ext.form.Action *

The subclasses of this class provide actions to perform upon {@link Ext.form.BasicForm Form}s.

*

Instances of this class are only created by a {@link Ext.form.BasicForm Form} when @@ -115,6 +121,11 @@ Ext.form.Action.prototype = { * during the time the action is being processed. */ +

/** + * @cfg {Boolean} submitEmptyText If set to true, the emptyText value will be sent with the form + * when it is submitted. Defaults to true. + */ +
/** * The type of action this Action instance performs. * Currently only "submit" and "load" are supported. @@ -333,10 +344,20 @@ Ext.extend(Ext.form.Action.Submit, Ext.form.Action, { // 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), @@ -345,6 +366,13 @@ Ext.extend(Ext.form.Action.Submit, Ext.form.Action, { 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); @@ -604,7 +632,7 @@ Ext.form.Action.DirectLoad = Ext.extend(Ext.form.Action.Load, { this.result = result; return result; }, - + success : function(response, trans){ if(trans.type == Ext.Direct.exceptions.SERVER){ response = {}; @@ -736,7 +764,7 @@ Ext.form.Action.DirectSubmit = Ext.extend(Ext.form.Action.Submit, { this.result = result; return result; }, - + success : function(response, trans){ if(trans.type == Ext.Direct.exceptions.SERVER){ response = {}; @@ -751,6 +779,6 @@ Ext.form.Action.ACTION_TYPES = { 'directload' : Ext.form.Action.DirectLoad, 'directsubmit' : Ext.form.Action.DirectSubmit }; -
- +
+ \ No newline at end of file