Search code examples
javascriptphppdfextjsextjs3

How to send parameters with a window src


I have the following code:

new Ext.Window({
        title: 'My PDF',
        height: 400,
        width: 600,
        bodyCfg: {
            tag: 'iframe',
            src: projectparameters.service + '__pdfService.php',
            params: {
                projectparameters: projectparameters_encoded,
                featureIDs: featureIDs_encoded
            },
            style: 'border: 0 none'
        }
    }).show();

I am trying to send parameters to the __pdfService.php Is this at all possible? I have tried using ifrmaes, but then the pdf 'encoding' is displayed instead of the actual pdf.

I cannot think that it can be such a mission do something this simple!!!

PS: If I query the service it returns a pdf in the window. So it works, I just want to send parameters through to make the pdf flexible


Solution

  • Update you code to and replace the param1 and param2 with your param names

      new Ext.Window({
                title: 'My PDF',
                height: 400,
                width: 600,
                bodyCfg: {
                    tag: 'iframe',
                    src: projectparameters.service + '__pdfService.php?param1=' + encodeURIComponent(param1) + '&param2=' + encodeURIComponent(param2),
                    style: 'border: 0 none'
                }
        }).show();