Resize based on WindowContent

6 posts, 1 answers
  1. Tom
    Tom avatar
    11 posts
    Member since:
    Apr 2008

    Posted 09 May 2008 Link to this post

     - Resize based on WindowContent
     - Disable Scrollbars

    I'm trying to display a RadWindow that when it loads will resize based on the size of the content inside the RadWindow iframe.  

    After it has been resized to fit the content I would like to disable the scrollbars for that iframe.

    Below is a sample of the javascript I've got so far but am having trouble disabling the scrollbars

    function GetSelectedWindow()
    {
        var oManager = GetRadWindowManager();
        return oManager.getActiveWindow();
    }

    function

    ChangeSize()
    {
        var oWindow = GetSelectedWindow();
        var width = oWindow._iframe.contentWindow.document.body.scrollWidth;
        var height = oWindow._iframe.contentWindow.document.body.scrollHeight;
        oWindow._iframe.style.overflow =
    'hidden';        //doesn't work
        Window._iframe.scrolling =
    'no';                      //doesn't work
        oWindow._enablePageScrolling(
    false);               //doesn't work
        oWindow.setSize(width, height);
    }

  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 10 May 2008 Link to this post

    Hello Tom,

    I assume that you are using XHTML DocType, am I correct? If this is so, note that in case you should modify not the body of the content page but the html which in Javascript is accessed via documentElement.
    e.g:

    function ChangeSize() 
        var oWindow = GetSelectedWindow(); 
        var innerFrame = oWindow.get_contentFrame().contentWindow; 
        innerFrame.document.documentElement.style.overflow ="hidden"



    Sincerely yours,
    Georgi Tunev
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Stephen
    Stephen avatar
    70 posts
    Member since:
    Mar 2008

    Posted 04 Apr 2009 Link to this post

    At what point do you call ChangeSize() js function?

    I'm using a window within the window maanger and opening the window with the following js function

    function OpenWindow(name, url)
    {
        var manager = GetRadWindowManager();
        manager.open(url, name);
    }


    Thanks,
    Stephen
  4. Stephen
    Stephen avatar
    70 posts
    Member since:
    Mar 2008

    Posted 04 Apr 2009 Link to this post

    Nevermind, figured it out.
  5. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 04 Apr 2009 Link to this post

    > Nevermind, figured it out.
    And the answer is?

    --
    Stuart
  6. Stephen
    Stephen avatar
    70 posts
    Member since:
    Mar 2008

    Posted 04 Apr 2009 Link to this post

    My issue turned out to be a little different.  I was just trying to remove the scrollbars showing up in the RadWindow, which I did by adding overflow: none; to the child aspx page.
Back to Top