1. #1
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Vote Rating
    0
    Answers
    2
    bee is on a distinguished road

      0  

    Default Unanswered: formsubit does not work

    Unanswered: formsubit does not work


    Hi, I am trying same functionality for submit as below, but does not work the alert message never appear even if it is success or failure. I am using extjs 4.0.7

    myFormPanel.getForm().submit({ clientValidation:true, url:'updateConsignment.php',params:{ newStatus:'delivered'}, success:function(form, action){Ext.Msg.alert('Success', action.result.msg);}, failure:function(form, action){switch(action.failureType){caseExt.form.Action.CLIENT_INVALID:Ext.Msg.alert('Failure','Form fields may not be submitted with invalid values');break;caseExt.form.Action.CONNECT_FAILURE:Ext.Msg.alert('Failure','Ajax communication failed');break;caseExt.form.Action.SERVER_INVALID:Ext.Msg.alert('Failure', action.result.msg);}}});

  2. #2
    Sencha User
    Join Date
    Mar 2011
    Posts
    208
    Vote Rating
    0
    Answers
    2
    bee is on a distinguished road

      0  

    Default


    Code:
    myFormPanel.getForm().submit({
        clientValidation: true,
        url: 'updateConsignment.php',
        params: {
            newStatus: 'delivered'
        },
        success: function (form, action) {
            Ext.Msg.alert('Success', action.result.msg);
        },
        failure: function (form, action) {
            switch (action.failureType) {
                caseExt.form.Action.CLIENT_INVALID: Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values');
                break;
                caseExt.form.Action.CONNECT_FAILURE: Ext.Msg.alert('Failure', 'Ajax communication failed');
                break;
                caseExt.form.Action.SERVER_INVALID: Ext.Msg.alert('Failure', action.result.msg);
            }
        }
    });