Class type Ext_form_action_Action.t


class type t = object .. end
Inherits
method failureType : Js.js_string Js.t Js.prop

The type of failure detected will be one of these: CLIENT_INVALID, SERVER_INVALID, CONNECT_FAILURE, or LOAD_FAILURE.

Usage:

var fp = new Ext.form.Panel({
...
buttons: [{
    text: 'Save',
    formBind: true,
    handler: function(){
        if(fp.getForm().isValid()){
            fp.getForm().submit({
                url: 'form-submit.php',
                waitMsg: 'Submitting your data...',
                success: function(form, action){
                    // server responded with success = true
                    var result = action.result;
                },
                failure: function(form, action){
                    if (action.failureType === Ext.form.action.Action.CONNECT_FAILURE) {
                        Ext.Msg.alert('Error',
                            'Status:'+action.response.status+': '+
                            action.response.statusText);
                    }
                    if (action.failureType === Ext.form.action.Action.SERVER_INVALID){
                        // server responded with success = false
                        Ext.Msg.alert('Invalid', action.result.errormsg);
                    }
                }
            });
        }
    }
},{
    text: 'Reset',
    handler: function(){
        fp.getForm().reset();
    }
}]

method response : 'a. 'a Js.t Js.prop

The raw XMLHttpRequest object used to perform the action.


method result : 'b. 'b Js.t Js.prop

The decoded response object containing a boolean success property and other, action-specific properties.


method _type : Js.js_string Js.t Js.prop

The type of action this Action instance performs. Currently only "submit" and "load" are supported.


method run : unit Js.meth

Invokes this action using the current configuration.