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

RadEditor toolbars not working when use RadWindow as the container

5 Answers 103 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Olivier
Top achievements
Rank 2
Olivier asked on 31 Jul 2012, 09:30 AM
Hello

If you want reproduce the bug, you must to add a RadEditor in the RadWindow.
When you get the content of the radeditor1 with your javascript we have Two <br/>
And in the Radeditor2 we Have on <br/>
You can see to choose HTML view.

I don't attach files on the thread but i can you send by mail a webform test.aspx

You see the code html on follow.

<form id="form1" runat="server">
  <div>
      <asp:ScriptManager ID="Sc1" runat="server"></asp:ScriptManager>
      <telerik:RadWindow ID="RadWindow1" Width="1000" Height="800" OnClientShow="OnClientShow" runat="server" VisibleOnPageLoad="true">
          <ContentTemplate>
              <div id="editorWrapper" style="padding: 5px; display: none;">
                  RADEDITOR WITH JAVASCRIPT, See the HTML
                  <telerik:RadEditor ID="RadEditor1" runat="server" height="200px"></telerik:RadEditor>
              </div>
              RADEDITOR WITHOUT JAVASCRIPT, See the HTML
              <telerik:RadEditor ID="RadEditor2" runat="server" height="200px"></telerik:RadEditor>
           
              <asp:button runat="server" ID="btn_save" Text="save" onclick="btn_save_Click"/>
 
              <asp:TextBox runat="server" ID="TextBox1" Width="150px"></asp:TextBox>
              <asp:TextBox runat="server" ID="TextBox2" Width="150px"></asp:TextBox>
          </ContentTemplate>
      </telerik:RadWindow>
 
      <script type="text/javascript">
          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("RadEditor1").ClientID %>');
              editor.onParentNodeChanged();
              var style = editor.get_contentArea().style;
              style.backgroundImage = "none";
              style.backgroundColor = "white";
          }
      </script>
  </div>
  </form>

You see the code CS on follow :

public partial class test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            this.RadEditor1.Content="hello 1";
            this.RadEditor2.Content="hello 2";
 
            this.TextBox1.Text = "";
            this.TextBox2.Text = "";
 
        }
 
        protected void btn_save_Click(object sender, EventArgs e)
        {
            this.TextBox1.Text = this.RadEditor1.Content;
            this.TextBox2.Text = this.RadEditor2.Content;
        }
 
    }

5 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 02 Aug 2012, 02:06 PM
Hello Olivier,

You need to call the onParentNodeChanged(); method for each RadEditor that is in the ContentTemplate of a RadWindow, not for the first one only. Once I added this:
function OnClientShow(sender, args)
{
    . . . . . .
 
    var editor2 = $find("<%=RadEditor2.ClientID %>");
    editor2.onParentNodeChanged();
}

things started working properly. For your convenience I am attaching here a page that displays the correct behavior along with a video that shows it.

Regards,
Marin Bratanov
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.
0
Joe
Top achievements
Rank 2
answered on 27 Jun 2013, 08:28 PM
This looks like it would help me but I cannot find the onParentNodeChanged() method.
It is not in the RadEditor API  http://www.telerik.com/help/aspnet-ajax/editor-getting-familiar-with-client-side-api.html
And when I have a break in the client script in Firefox there is no method there either.
Please help me understand why it is that I cannot find the same method you have demonstrated.
Thanks, Joe
0
Ianko
Telerik team
answered on 28 Jun 2013, 02:07 PM
Hello Joseph,

I have addressed your problem in the support ticket you opened about the same problem. Please review the provided answer and get back to me if there are any more concerns.

For future issues you want to report I would suggest starting only one support ticket/forum thread for a particular scenario. This way it will be easier to track the information on the case, better understand the problematic scenario and respectively provide you with a solution faster. That being said, let us continue our discussion in your support ticket on the matter.

Ianko
Telerik
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 the blog feed now.
0
Bryan
Top achievements
Rank 1
answered on 11 Aug 2013, 01:10 PM
I am also having the same issues in this scenario.  Has there been a resolution?

0
Ianko
Telerik team
answered on 13 Aug 2013, 11:04 AM
Hello Bryan,

If the case is using the RadEditor control in a RadWindow you could follow this help article for more information.

The solution described there is about using the Client-side APIs of the two controls to invoke the onParentNodeChanged() method of the editor when the OnClientShow event of the RadWindow is raised.

More information about the APIs can be found in these articles:
  1. RadWindow:
  2. RadEditor:

If this is not the troubling case please share with me the details about the encountered problem, so that I could suggest a more to the point solutions. 

Regards,
Ianko
Telerik
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 the blog feed now.
Tags
Editor
Asked by
Olivier
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Joe
Top achievements
Rank 2
Ianko
Telerik team
Bryan
Top achievements
Rank 1
Share this question
or