-
15 Sep 2009 10:31 PM #1
[Solved] Closing Popup Ext.Window from within IFRAME html button
[Solved] Closing Popup Ext.Window from within IFRAME html button
I am having trouble figuring out how to close an Popup Ex.Window from within a page nested in a ManagedIFrame using a standard html button event.
Have basic level knowledge with Java but slowly learning along with Ext so just need someone to finger point in a direction. My app has a mixture of Ext, ASS Classic and standard HTML.
Am opening the popup via image link (see code below) which loads the Ext.Window and page url into the ManagedIFrame as specified by winURL. This all works fine.
I would now like to close this window via an event on the Cancel button. I have tried various methods most resulting in “win is not define” etc.. which I understand as it can’t be seen I’m guessing. I’m not sure where to go next.
CheersCode:function showEditWindow(winTitle,winWidth,winHeight,winURL) { var win = new Ext.Window({ title: winTitle, width: winWidth, height: winHeight, modal: 'true', layout: 'fit' , items: [new Ext.ux.ManagedIFrame.Panel( { defaultSrc:winURL, loadMask: false } )] }); win.show(); return win; };
-
16 Sep 2009 12:54 AM #2
@PlanetTechman -- You would generally access the global namespace of the parent page via:
window.top or window.parent
Give your Ext Container (the Ext.Window) an ID so it can be found, making this possible:
Code:button.onclick = function(e){ var win = window.parent.Ext.getCmp('MIFWin'); if(win)win[win.closeAction](); }"be dom-ready..."
Doug Hendricks
Maintaining ux: ManagedIFrame, MIF2 (FAQ, Wiki), ux.Media/Flash, AudioEvents, ux.Chart[Fusion,OFC,amChart], ext-basex.js/$JIT, Documentation Site.
Got Sencha licensing questions? Find out more here.
-
16 Sep 2009 11:56 AM #3
[SOLVED] Closing Popup Ext.Window from within IFRAME html button
[SOLVED] Closing Popup Ext.Window from within IFRAME html button
Works perfectly. All makes sense when I see it like that.
Thank you Doug

-
28 Feb 2011 3:54 PM #4
Many thanks
Many thanks
I have spent at least two days trying to find a way to close my popup window from a bbar CANCEL button. I did try many suggested options like findParentByType, Ext.getCmp('myWindow').close(), this.ownerCt.ownerCt.ownerCt.ownerCt.close(), ... Nothing seem to be working until I found this thread.
This forun is so usefull and your contibution is helpful and greatly appreciated.
Many thanks to all of you.
Please continue your great works



-
19 Feb 2013 10:00 PM #5
That's cool and is what I'm looking for. I believe this will open the door between extjs and other framework like jQuery or even plain javascript.
Last edited by elgs; 19 Feb 2013 at 10:01 PM. Reason: typo
-
20 Feb 2013 1:40 AM #6
Is it possible for the parent to access the components in the child? Say setting focus. Thanks.
-
20 Feb 2013 2:17 AM #7
I got answer to my own question after some investigation.
Code:var ifrm = document.getElementById('signInIframe'); ifrm = (ifrm.contentWindow) ? ifrm.contentWindow : (ifrm.contentDocument.document) ? ifrm.contentDocument.document : ifrm.contentDocument; var focusables = ifrm.Ext.ComponentQuery.query('textfield:focusable'); if(focusables!==null&&focusables.length>0){ focusables[0].focus(false, 200); }


Reply With Quote



