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

contentWindow for radEditor document IFrame

1 Answer 128 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Paul Robertson
Top achievements
Rank 1
Paul Robertson asked on 24 May 2012, 05:27 PM

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!

Regards

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 25 May 2012, 01:45 PM
Hi,

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,
Rumen
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.
Tags
Editor
Asked by
Paul Robertson
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or