Upgrade to ExtJS 4.0.7 - Released 10/19/2011
[extjs.git] / src / form / action / StandardSubmit.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /**
16  * @class Ext.form.action.StandardSubmit
17  * @extends Ext.form.action.Submit
18  * <p>A class which handles submission of data from {@link Ext.form.Basic Form}s using a standard
19  * <tt>&lt;form&gt;</tt> element submit. It does not handle the response from the submit.</p>
20  * <p>If validation of the form fields fails, the Form's afterAction method
21  * will be called. Otherwise, afterAction will not be called.</p>
22  * <p>Instances of this class are only created by a {@link Ext.form.Basic Form} when
23  * {@link Ext.form.Basic#submit submit}ting, when the form's {@link Ext.form.Basic#standardSubmit}
24  * config option is <tt>true</tt>.</p>
25  */
26 Ext.define('Ext.form.action.StandardSubmit', {
27     extend:'Ext.form.action.Submit',
28     alias: 'formaction.standardsubmit',
29
30     /**
31      * @cfg {String} target
32      * Optional <tt>target</tt> attribute to be used for the form when submitting. If not specified,
33      * the target will be the current window/frame.
34      */
35
36     /**
37      * @private
38      * Perform the form submit. Creates and submits a temporary form element containing an input element for each
39      * field value returned by {@link Ext.form.Basic#getValues}, plus any configured {@link #params params} or
40      * {@link Ext.form.Basic#baseParams baseParams}.
41      */
42     doSubmit: function() {
43         var form = this.buildForm();
44         form.submit();
45         Ext.removeNode(form);
46     }
47
48 });
49