This is a migrated thread and some comments may be shown as answers.

Resize based on WindowContent

5 Answers 200 Views
Window
This is a migrated thread and some comments may be shown as answers.
Tom
Top achievements
Rank 1
Tom asked on 09 May 2008, 01:39 PM

 - 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);
}

5 Answers, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 10 May 2008, 02:28 PM
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
0
Stephen
Top achievements
Rank 1
answered on 04 Apr 2009, 06:52 AM
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
0
Stephen
Top achievements
Rank 1
answered on 04 Apr 2009, 07:04 AM
Nevermind, figured it out.
0
Stuart Hemming
Top achievements
Rank 2
answered on 04 Apr 2009, 12:16 PM
> Nevermind, figured it out.
And the answer is?

--
Stuart
0
Stephen
Top achievements
Rank 1
answered on 04 Apr 2009, 05:04 PM
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.
Tags
Window
Asked by
Tom
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Stephen
Top achievements
Rank 1
Stuart Hemming
Top achievements
Rank 2
Share this question
or