Results 1 to 7 of 7

Thread: [Solved] Closing Popup Ext.Window from within IFRAME html button

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext User
    Join Date
    Jan 2009
    Posts
    2
    Vote Rating
    0
      0  

    Default [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 cant be seen Im guessing. Im not sure where to go next.
    Code:
    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;
       };
    Cheers
    Attached Images Attached Images

  2. #2
    Sencha User hendricd's Avatar
    Join Date
    Aug 2007
    Location
    Long Island, NY USA
    Posts
    5,966
    Vote Rating
    15
      1  

    Default

    Quote Originally Posted by PlanetTechman View Post
    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 cant be seen Im guessing. Im not sure where to go next.
    Code:
    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;
       };
    Cheers

    @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.


  3. #3
    Ext User
    Join Date
    Jan 2009
    Posts
    2
    Vote Rating
    0
      0  

    Thumbs up [SOLVED] Closing Popup Ext.Window from within IFRAME html button

    Works perfectly. All makes sense when I see it like that.
    Thank you Doug

  4. #4
    Sencha User
    Join Date
    Jun 2010
    Posts
    4
    Vote Rating
    0
      0  

    Default 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

  5. #5
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    195
    Vote Rating
    25
      0  

    Default

    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

  6. #6
    Sencha Premium Member
    Join Date
    Apr 2010
    Posts
    195
    Vote Rating
    25
      0  

    Default

    Is it possible for the parent to access the components in the child? Say setting focus. Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •