相关疑难解决方法(0)

为什么在extjs表单提交中不调用成功回调?

我正在尝试使用Ext JS表单上传文件,如果成功或失败,请显示相应的消息.但我无法获得理想的结果.我无法制作successfailure回调作品form.submit.

我到现在所做的是:

使用此脚本创建表单:

new Ext.FormPanel({
    fileUpload: true,
    frame: true,
    url: '/profiler/certificate/update',
    success: function() {
        console.log(arguments);
    },
    failure: function() {
        console.log(arguments);
    }
}).getForm().submit()


?/*
    The response Content-Type is text/html (with charcode=utf8);
    The response JSON is: { "success": true }
*/??
Run Code Online (Sandbox Code Playgroud)

设置响应Content-Typetext/html基于这个答案.
基于Ext JS文档发回适当的JSON结果.通过Fiddler捕获的回复是:

{"success":false}
Run Code Online (Sandbox Code Playgroud)

要么

{"success":true}
Run Code Online (Sandbox Code Playgroud)

我甚至将响应Content-Type设置为application/json.但仍然没有成功.

我读过类似链接这个这个,但他们没有帮助.请注意,我还尝试了另一个创建表单的脚本,其中包含一个上传字段和一个保存按钮,我在保存按钮的处理程序中提交了表单.但仍然没有引发回调.

extjs file-upload extjs4

10
推荐指数
1
解决办法
3万
查看次数

标签 统计

extjs ×1

extjs4 ×1

file-upload ×1