Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / src / form / action / StandardSubmit.js
1 /**
2  * @class Ext.form.action.StandardSubmit
3  * @extends Ext.form.action.Submit
4  * <p>A class which handles submission of data from {@link Ext.form.Basic Form}s using a standard
5  * <tt>&lt;form&gt;</tt> element submit. It does not handle the response from the submit.</p>
6  * <p>If validation of the form fields fails, the Form's {@link Ext.form.Basic#afterAction} method
7  * will be called. Otherwise, afterAction will not be called.</p>
8  * <p>Instances of this class are only created by a {@link Ext.form.Basic Form} when
9  * {@link Ext.form.Basic#submit submit}ting, when the form's {@link Ext.form.Basic#standardSubmit}
10  * config option is <tt>true</tt>.</p>
11  */
12 Ext.define('Ext.form.action.StandardSubmit', {
13     extend:'Ext.form.action.Submit',
14     alias: 'formaction.standardsubmit',
15
16     /**
17      * @cfg {String} target
18      * Optional <tt>target</tt> attribute to be used for the form when submitting. If not specified,
19      * the target will be the current window/frame.
20      */
21
22     /**
23      * @private
24      * Perform the form submit. Creates and submits a temporary form element containing an input element for each
25      * field value returned by {@link Ext.form.Basic#getValues}, plus any configured {@link #params params} or
26      * {@link Ext.form.Basic#baseParams baseParams}.
27      */
28     doSubmit: function() {
29         var form = this.buildForm();
30         form.submit();
31         Ext.removeNode(form);
32     }
33
34 });