PDA

View Full Version : Submit form target in extjs 4



marco-broglia-sifa
20 Jan 2014, 2:25 AM
Hi all,

in extjs 3 i have a window containing 2 items:
- an iframe (Ext.ux.IFrameComponent)
- a form

then i want to standardSubmit the form using the Iframe as target..this because the submission of the form produce a pdf that will be displayed into the iframe.

this is the code:


form.getForm().getEl().dom.target = 'OutputIframe';
form.getForm().getEl().dom.action = urlPath;
form.getForm().submit();

All works fine.
Now i want to do the same with extjs 4.
The window remain the same using Ext.ux.IFrame as class for the iframe.
The new submission code is:


form.getForm().doAction('standardsubmit',{
target : 'OutputIframe',
standardSubmit:true,
url : urlPath
});

but with this code the pdf is displayed in a new browser window instead of the iframe.
How can i produce the same effect of the 3 version?

Thanks a lot

Malte123
20 Jan 2014, 8:31 AM
PHP Code:
form.getForm().doAction('standardsubmit',{
target : 'OutputIframe',
standardSubmit:true,
url : urlPath
});


but with this code the pdf is displayed in a new browser window instead of the iframe.

I think you can do this by



target: Ext.get(form) // and something to find the Id ?

marco-broglia-sifa
20 Jan 2014, 8:36 AM
mmm...'OutputIframe' is the id of my element.With Ext.getCmp('OutputIframe') does not work, as soon as I can I try with Ext.get('OutputIframe').Thanks in any case for your help

Malte123
20 Jan 2014, 4:22 PM
Thanks in any case for your help

also how I do to figure out thinks like that, you can console.log(Ext.getCmp('OutputIframe')) ... or with get ... and navigate the DOM on Debug-Console of Browser (FireBug for example)

By this you can find out more and figure out by diving the DOM like



Ext.getById('OutputIframe').figured.Out.Dom.Elm.Where.To.Put // LOL


Best Thank You is: VOTE me UP (I like this feeling) B)

marco-broglia-sifa
21 Jan 2014, 12:29 AM
Using Ext.getCmp('OutputIframe').iframeEl.dom as target does not work. Can u be more specific?Thanks a lot

Malte123
21 Jan 2014, 12:00 PM
at the moment I have no new Idea - maybe you play arround a little bit.

For example: Try to make target a local Link to a different html file.
Or maybe _blank like normal a href ...
I am not deap in you Problem - I only want to give you some ideas to help you solving yourself ... I know your feeling :-)

marco-broglia-sifa
22 Jan 2014, 12:08 AM
At the end i've resolved using standard javascript. I've make an iframe with a form with stad javascript and i've added it with appendChild to my extjs Window.Thanks for help :).

Malte123
22 Jan 2014, 3:54 PM
At the end i've resolved using standard javascript. I've make an iframe with a form with stad javascript and i've added it with appendChild to my extjs Window.Thanks for help :).



Great B)

So please vote all helpful Answers up and select that one as "best answer" is helping others.
It is also motivation to helping users :)

Maybe it is your Answer in this case.