solarissf
solarissf

Reputation: 1277

extjs form.submit to download file - url not being passed correctly

I am trying to download a file via a button click from server. My form.submit does not seem to be sending my urlwhen publish my ExtJS project using IIS. When I run the project from visual studio is works just fine, but when I publish the project looking at fiddler it does not seem to have parameters or the correct URL.

Does anyone know what I am doing wrong?

        var me = this;
    var form = Ext.create('Ext.form.Panel', {
        standardSubmit: true,
        method: 'GET',
        url: 'http://xxx/xxx/api/excel/CreatePosSheet/'
    });

    form.submit({            
        params: {
            cName: me.selectedClientDisplayField.getValue(),
            calcMethod: 'settle',
            username: me.unameGlobal,
            cid: me.cidGlobal
        }
    });

enter image description here

I noticed that the url is not correct either, I specifically state url: 'http://111.111.111.11/myServiceV003/api/excel/CreatePosSheet/' but in fiddler I see /mainofmyproject/.js.

Also, when I change standardSubmit to false, the url gets passed correctly, but the download popup window I am waiting for never shows up.

Upvotes: 0

Views: 276

Answers (1)

Alexander
Alexander

Reputation: 20224

Generally speaking, the .js error 404 is because you are missing a requirement of a component that is referenced from your code (or the code referenced therein) by xtype only. If you check the browser console of your development app, you should see the message:

[W] [Ext.Loader] Synchronously loading 'Ext.form.action.StandardSubmit'; Consider adding Ext.requires('Ext.form.action.StandardSubmit') above Ext.onReady()

Because if you want to use a form with standardSubmit:true, you have to add requires:['Ext.form.action.StandardSubmit'] to the file where you create the form (documented nowhere...).

Upvotes: 1

Related Questions