contentWindow for radEditor document IFrame

2 posts, 0 answers
  1. Paul Robertson
    Paul Robertson avatar
    78 posts
    Member since:
    May 2010

    Posted 24 May 2012 Link to this post

    Hello there

    Can anybody resolve a confusion for me? I'm trying to run some Range manipulation, using a cross-browser compatible Javascript library (it is called 'rangy').

    I know that the radEditor has its own client-side getSelection() function etc. The problem is that the 'rangy' library can only work with Selection objects that it creates itself, and that means it needs to be passed a reference to the Iframe object of the radEditor. Specifically though, it expects that the Iframe object in question should be in possession of a 'contentWindow' property. Is this usually just standard for Iframes that fill a window, as it seems to me from investigating the radEditor document DOM that the IFrame object returned by the radEditor's get_document() function does not have a value set for 'contentWindow'.

    Am I missing something obvious here? Should the radEditor's Iframe document have a 'contentWindow' set? If this property can be set  manually, how should I get a reference to the correct Window object?

    Thanks if you can sort this confusion out for me!


  2. Rumen
    Rumen avatar
    14413 posts

    Posted 25 May 2012 Link to this post


    You can use editor.get_contentWindow() or editor.get_contentAreaElement().contentWindow to get a reference to the contentWindow of RadEditor's iframe.

    All the best,
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top