1

I need a callback on file download. Now I can not do this, because I have to set standardSubmit to true. This is how it looks like in my case:

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"}});

It all looks good with one minor exception - I can not set a callback. This is what I wanted to achive:

panel.getForm().submit({url:"controller/download.php",callback:function () {
... do something when file was downloaded (for example - hide a loading mask)
}}});
Jacobian
  • 10,122
  • 29
  • 128
  • 221
  • Why do you have to set standardSubmit to true? http://docs.sencha.com/extjs/6.0.1-classic/Ext.form.Basic.html#method-hasUpload – Alexander Aug 22 '16 at 16:01
  • I do not want to upload a file, but rather to download. When my procedure is triggered, I create a file on the server side and return necessary headers to the client, so the download window pops up, and a user can save it to the drive. – Jacobian Aug 22 '16 at 16:22
  • When I set `standardSubmit` to `false`, it stops working. – Jacobian Aug 22 '16 at 16:22

0 Answers0