浏览 3107 次
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2007-11-13
if(owner.formPanel.form.isValid()){ owner.formPanel.form.submit({ url:'../../backManage/employeeNew.action', method:'post', success:function(thisForm,thisAction){ alert(thisAction.result.msg); if(thisAction.result.result==0) owner.store.reload(); }, failure:function(thisForm,thisAction){ alert(thisAction.result.msg); }, scope:this, clientValidation:false }); } 后台返回数据格式: 成功执行返回 {result:0,msg:'修改成功'} 抛出异常返回 {result:1,msg:'"+e.getMessage()+"'} 问题:不明白为什么form提交后只会调用failure函数,无论成功执行或者抛出异常 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2007-11-14
A response packet must contain a boolean success property, and, optionally an errors property. The errors property contains error messages for invalid fields.
By default, response packets are assumed to be JSON, so a typical response packet may look like this: { success: false, errors: { clientCode: "Client not found", portOfLoading: "This field must not be null" } } |
|
返回顶楼 | |
发表时间:2008-06-26
只要你后台有返回值就只会执行failure方法
|
|
返回顶楼 | |