RadWindow inside iframe

3 posts, 0 answers
  1. Alan T
    Alan T avatar
    125 posts
    Member since:
    Apr 2010

    Posted 17 Feb 2012 Link to this post

    Hi there,

    Now i'm not sure if there's a solution for this particular problem.

    Scenario; Client has a site(a) in which they want to embed sections from the site i'm developing, site(b).
    To enable them to do so i'm providing them with some iframe markup to put into their CMS.

    The problem being, that some of the pages they're embedding have radwindows in, and these RadWindows are wider than the size of the iframe the page is contained within.

    Try try and resolve this i made the iframe larger than the actual content, and overlay some of their content on site(a), using a transparent background on the iframe. This allowed my RadWindow sufficient space.

    However, what i had overlooked is if there's any content underneath the iframe, such as links etc, they're no longer accessible because the iframe is above them .

    So i guess my question would be; is there a solution for this ? I guess what i need is the RadWindow to open independantly so its not restricted by the size of the iframe it's in. However, i also need it to be able to interact with the page at which it is called from (i use the closeandrebind event for radgrid/window).

    Any suggestions welcome,

  2. Marin Bratanov
    Marin Bratanov avatar
    5910 posts

    Posted 20 Feb 2012 Link to this post

    Hi Alan,

    This is a general layout issue that is not related to the RadControls in any way. How to organize the real estate of your page so that both the iframe and the controls around it are visible is a decision the developers and designers should take to match their needs.

    In case the most common use of your page is to be loaded in this iframe you may redesign it so that it does not require this much space.

    Overall, there is only one way to ensure that a RadWindow will not be locked in an iframe and this is to open it from the topmost frame of the site. This approach has some limitations, though - the most important one is that both pages must come from the same domain in order for JavaScript to allow the cross-frame function call. The second is that the parent page must be prepared to receive the command to open the certain RadWindow (easiest done by using radopen and a RadWindowManager). To utilize this approach you may find the following resources useful: here and here for checking if you are in an iframe or RadWindow and here for calling functions accross different iframes and RadWindows (get_contentFrame() returns a DOM reference to the iframe of the RadWindow so you can replace it with a getElementById("your iframe") ) to call a function from the context of the main page in your own page.

    Kind regards,
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. Alan T
    Alan T avatar
    125 posts
    Member since:
    Apr 2010

    Posted 23 Feb 2012 Link to this post


    thanks Marin.

Back to Top