Ext.form.BasicForm.submit() 的success与failure如何触发
Ext.form.BasicForm的submit方法如下定义
myFormPanel.getForm().submit({
success: function(form, action) {alert(1)},
failure: function(form, action) {alert(2)}
});
为什么触发不了success 或 failure 的function呢?
折腾了一下,原来服务器中返回的须是如下格式的json字符串:
{ success: true, msg: 'Consignment updated'}
或:
{ success: false, msg: 'You do not have permission to perform this operation'}
上面两个json字符串分别触发success和failure分支。