问题
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
}
});
回答1:
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.
来源:https://stackoverflow.com/questions/18434962/extjs-handling-success-or-failure-when-doing-a-standard-submit-in-a-form