Results 1 to 2 of 2

Thread: Make iframe grow with contents

  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    38
    Vote Rating
    1
      0  

    Question Make iframe grow with contents

    I'm initializing an Ext form in an iframe. This iframe is in a modal 'popup' layer in another application. Now, the form can grow vertically when inputting data. This eventually causes the submit button to be pushed outside the screen. What would be the best way to make this iframe grow along with the body? I tried attaching something to the body's 'onresize' event, but it's never fired.
    Regards,
    Rijk van Wel

  2. #2
    Ext JS Premium Member
    Join Date
    Feb 2011
    Posts
    38
    Vote Rating
    1
      0  

    Default

    For now, I did it by removing the (inline) CSS width and height, and adding those as attributes (width=x height=x). Then I can change the iframe's size from within the iframe with:

    Code:
    window.frameElement.height
    So now I'm just doing this periodically;

    Code:
    Ext.TaskMgr.start({
        run: function() { window.frameElement.height = Ext.getBody().getHeight(); },
        interval: 1000
    });
    Regards,
    Rijk van Wel

Posting Permissions

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