提交表单,下载文件并进行回调

时间:2016-08-22 15:50:47

标签: javascript extjs

我需要回调文件下载。现在我不能这样做,因为我必须将standardSubmit设置为true。这就是我的情况:

var panel = Ext.create('Ext.form.Panel', {
                method:'POST',
                standardSubmit: true,
                items:[{
                    xtype: "textfield",
                    name: "field1"
                },...] // other similar fields

// based on those panel fields, I create a file on the server side
// and return it to the client
panel.getForm().submit({url:"controller/download.php"}});

这一切看起来都不错,只有一个小例外 - 我无法设置回调。这就是我想要实现的目标:

panel.getForm().submit({url:"controller/download.php",callback:function () {
... do something when file was downloaded (for example - hide a loading mask)
}}});

0 个答案:

没有答案