Extjs,在表单中执行标准提交时处理成功或失败 [英] Extjs, handling success or failure when doing a standard submit in a form
本文介绍了Extjs,在表单中执行标准提交时处理成功或失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
任何帮助将不胜感激。
var form = Ext.create('Ext.form.Panel',{
standardSubmit: true,
url:'../ObtenerArchivoAdjuntoServlet',
});
form.submit({
waitMsg:'Descargando ...',
params:{
nombreArchivo :nombreArchivo
},
成功:function(form,action){//未被触发
//做某事
},
失败:function(form,action){//未被触发
//做某事
}
});
解决方案
您无法处理成功或失败,因为一次你提交它,它的工作原理像一个普通的旧HTML表单发布,浏览器将URL更改为一个新页面,所以你永远都不会知道结果。
I'm downloading a file from a servlet with a form submit in Ext, but when I try to handle the success or failure of my submit it just never get fired and my waitMsg goes on forever.
Any help would be appreciated.
var form = Ext.create('Ext.form.Panel',{
standardSubmit: true,
url: '../ObtenerArchivoAdjuntoServlet',
});
form.submit({
waitMsg: 'Descargando...',
params:{
nombreArchivo:nombreArchivo
},
success: function(form, action){ //not getting fired
//do something
},
failure: function(form, action){ // not getting fired
//do something
}
});
解决方案
You can't handle success or failure, because once you submit it, it works like a normal old HTML form post, the browser changes the URL to a new page, so you can never know the result.
这篇关于Extjs,在表单中执行标准提交时处理成功或失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文