PDA

View Full Version : formsubit does not work



bee
26 Nov 2011, 11:47 PM
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) { case Ext.form.Action.CLIENT_INVALID: Ext.Msg.alert('Failure', 'Form fields may not be submitted with invalid values'); break; case Ext.form.Action.CONNECT_FAILURE: Ext.Msg.alert('Failure', 'Ajax communication failed'); break; case Ext.form.Action.SERVER_INVALID: Ext.Msg.alert('Failure', action.result.msg); } }});

bee
26 Nov 2011, 11:49 PM
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);
}
}
});