Extjs, handling success or failure when doing a standard submit in a form

时光怂恿深爱的人放手 提交于 2019-12-24 03:23:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!