lib/Ext/form/Panel.js
function(options, e) {
        options = options || {};

        var me = this,
            formValues = me.getValues(me.getStandardSubmit() || !options.submitDisabled),
            form = me.element.dom || {};

        if(this.getEnableSubmissionForm()) {
            form = this.createSubmissionForm(form, formValues);
        }

        options = Ext.apply({
            url : me.getUrl() || form.action,
            submit: false,
            form: form,
            method : me.getMethod() || form.method || 'post',
            autoAbort : false,
            params : null,
            waitMsg : null,
            headers : null,
            success : null,
            failure : null
        }, options || {});

        return me.fireAction('beforesubmit', [me, formValues, options, e], 'doBeforeSubmit', null, null, 'after');
    }
function(options, e) {
        options = options || {};

        var me = this,
            formValues = me.getValues(me.getStandardSubmit() || !options.submitDisabled),
            form = me.element.dom || {};

        if(this.getEnableSubmissionForm()) {
            form = this.createSubmissionForm(form, formValues);
        }

        options = Ext.apply({
            url : me.getUrl() || form.action,
            submit: false,
            form: form,
            method : me.getMethod() || form.method || 'post',
            autoAbort : false,
            params : null,
            waitMsg : null,
            headers : null,
            success : null,
            failure : null
        }, options || {});

        return me.fireAction('beforesubmit', [me, formValues, options, e], 'doBeforeSubmit', null, null, 'after');
    }
Performs a Ajax-based submission of form values (if {@link #standardSubmit} is false) or otherwise
executes a standard HTML Form submit action.

**Notes**

1. Only the first parameter is implemented. Put all other parameters inside the first
parameter:

submit({params: "" ,headers: "" etc.})

2. Submit example:

myForm.submit({
url: 'PostMyData/To',
method: 'Post',
success: function() { Ext.Msg.alert("success"); },
failure: function() { Ext.Msg.alert("error"); }
});

3. Parameters and values only submit for a POST and not for a GET.

@param {Object} options
The configuration when submitting this form.

The following are the configurations when submitting via Ajax only:

@param {String} options.url
The url for the action (defaults to the form's {@link #url}).

@param {String} options.method
The form method to use (defaults to the form's {@link #method}, or POST if not defined).

@param {Object} options.headers
Request headers to set for the action.

@param {Boolean} [options.autoAbort=false]
`true` to abort any pending Ajax request prior to submission.
__Note:__ Has no effect when `{@link #standardSubmit}` is enabled.

@param {Number} options.timeout
The number is seconds the loading will timeout in.

The following are the configurations when loading via Ajax or Direct:

@param {String/Object} options.params
The params to pass when submitting this form (defaults to this forms {@link #baseParams}).
Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.

@param {Boolean} [options.submitDisabled=false]
`true` to submit all fields regardless of disabled state.
__Note:__ Has no effect when `{@link #standardSubmit}` is enabled.

@param {String/Object} [options.waitMsg]
If specified, the value which is passed to the loading {@link #masked mask}. See {@link #masked} for
more information.

@param {Function} options.success
The callback that will be invoked after a successful response. A response is successful if
a response is received from the server and is a JSON object where the `success` property is set
to `true`, `{"success": true}`.

The function is passed the following parameters and can be used for submitting via Ajax or Direct:

@param {Ext.form.Panel} options.success.form
The {@link Ext.form.Panel} that requested the action.

@param {Object/Ext.direct.Event} options.success.result
The result object returned by the server as a result of the submit request. If the submit is sent using Ext.Direct,
this will return the {@link Ext.direct.Event} instance, otherwise will return an Object.

@param {Object} options.success.data
The parsed data returned by the server.

@param {Function} options.failure
The callback that will be invoked after a failed transaction attempt.

The function is passed the following parameters and can be used for submitting via Ajax or Direct:

@param {Ext.form.Panel} options.failure.form
The {@link Ext.form.Panel} that requested the submit.

@param {Ext.form.Panel} options.failure.result
The failed response or result object returned by the server which performed the operation.

@param {Object} options.success.data
The parsed data returned by the server.

@param {Object} options.scope
The scope in which to call the callback functions (The `this` reference for the callback functions).

@return {Ext.data.Connection} The request object if the {@link #standardSubmit} config is false.
If the standardSubmit config is true, then the return value is undefined.