Hi,
There is a problem with adding an event handler to a RadEditor when combined with a RadWindow. First I had some issues with the toolbar, and fixed them with the proposed workaround here http://www.telerik.com/community/forums/aspnet-ajax/window/radeditor-toolbars-not-working-when-use-radwindow-as-the-container.aspx
Unfortunately, this does not solve the issue with the registered event handlers.
I need to capture whatever the user types in the RadEditor. It works fine when the RadEditor is not inside a RadWindow... Is there any solution to this issue?
Here is an example to reproduce the problem. One RadEditor outside the RadWindow and another inside one. I tried several things, like adding a <div> as a wrapper, add an space in the Content tag, etc... but nothing works.
Any idea how to solve this?
Many thanks!
There is a problem with adding an event handler to a RadEditor when combined with a RadWindow. First I had some issues with the toolbar, and fixed them with the proposed workaround here http://www.telerik.com/community/forums/aspnet-ajax/window/radeditor-toolbars-not-working-when-use-radwindow-as-the-container.aspx
Unfortunately, this does not solve the issue with the registered event handlers.
I need to capture whatever the user types in the RadEditor. It works fine when the RadEditor is not inside a RadWindow... Is there any solution to this issue?
Here is an example to reproduce the problem. One RadEditor outside the RadWindow and another inside one. I tried several things, like adding a <div> as a wrapper, add an space in the Content tag, etc... but nothing works.
Any idea how to solve this?
<form id="form1" runat="server"> <asp:ScriptManager ID="MyScriptManager" runat="server"></asp:ScriptManager> <div> <telerik:RadWindow ID="RadWindow1" Width="750" Height="500" OnClientShow="OnClientShow" runat="server" VisibleOnPageLoad="true"> <ContentTemplate> <div id="editorWrapper" style="padding: 5px; display: none;"> <telerik:RadEditor ID="RadEditorWithRadWindow" OnClientLoad="RadEditorWithRadWindowOnClientLoad" runat="server" Width="600px" Height="250px" Visible="true" EnableEmbeddedScripts="true"> <Content> </Content> </telerik:RadEditor> </div> </ContentTemplate> </telerik:RadWindow> <telerik:RadEditor ID="RadEditorNoRadWindow" OnClientLoad="RadEditorNoRadWindowOnClientLoad" runat="server" Width="600px" Height="250px" Visible="true" EnableEmbeddedScripts="true"> <Content> </Content> </telerik:RadEditor> <script type="text/javascript"> function RadEditorWithRadWindowOnClientLoad(editor, args) { editor.attachEventHandler("onkeypress", function (e) { alert('We CANNOT reach this one'); } ); } function RadEditorNoRadWindowOnClientLoad(editor, args) { editor.attachEventHandler("onkeypress", function (e) { alert('We CAN reach this one'); } ); } function OnClientShow(sender, args) { // Fix the size problem in IE. var editorParent = $get('editorWrapper'); editorParent.style.display = ''; // Fixes the problem with the content area in FF and Safari var editor = $find('<%= RadWindow1.ContentContainer.FindControl("RadEditorWithRadWindow").ClientID %>'); editor.onParentNodeChanged(); var style = editor.get_contentArea().style; style.backgroundImage = "none"; style.backgroundColor = "white"; } </script> </div> </form>Many thanks!