Results 1 to 3 of 3

Thread: Creating window from iframe in different versions, setting height correctly

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Sep 2010
    Posts
    19

    Default Creating window from iframe in different versions, setting height correctly

    Here is a code:


    Code:
    function resizeIframe(obj)
    {
        obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';
    }
    var someCfg  = {
    ...
        layout:'fit',
        width: 800,
        border: false,
        modal: true,
        resizable: false,
        html:'<iframe id="someId" src="somePath" frameBorder="0" style="width: 100%; height: 100%;" scrolling="no" onload="javascript:resizeIframe(this);"></iframe>',
        ...
    }
    
    
    new Ext.Window(someCfg).show();
    In ExtJs 3 everything works fine. The correct height of iframe is calculated, the modal window displays correctly.


    But in ExtJs 4 and ExtJs 5 versions, the size of the window is always the same = 150px (in Chrome)


    How can this be resolved? I can set statically the height property:


    Code:
    var someCfg  = {
    ...
    
    
        height: 700;
    }
    But the content in the source can vary, the height is changed, so it's not a good solution.

  2. #2
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45

    Default

    Instead of setting the height and width instead you could try setting the maxHeight and maxWdith configs. Although I am curious why would you need an iframe at all?

  3. #3
    Sencha User
    Join Date
    Sep 2010
    Posts
    19

    Default

    Quote Originally Posted by jdkhamba View Post
    Instead of setting the height and width instead you could try setting the maxHeight and maxWdith configs. Although I am curious why would you need an iframe at all?
    In our application different versions of Ext Js are used on different pages. Using iframe let's to use concrete Ext Js version for concrete feature.

Similar Threads

  1. Replies: 2
    Last Post: 18 May 2012, 6:05 AM
  2. Window Height not Setting
    By ProfK in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 25 Feb 2009, 7:53 AM
  3. Replies: 3
    Last Post: 8 Feb 2009, 1:44 AM

Tags for this Thread

Posting Permissions

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