RadEditor toolbars not working when use RadWindow as the container

6 posts, 0 answers
  1. Olivier
    Olivier avatar
    146 posts
    Member since:
    Nov 2010

    Posted 31 Jul 2012 Link to this post

    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;
            }
     
        }

  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 02 Aug 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Joe
    Joe avatar
    11 posts
    Member since:
    May 2012

    Posted 27 Jun 2013 Link to this post

    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
  5. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 28 Jun 2013 Link to this post

    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.
  6. Bryan
    Bryan avatar
    3 posts
    Member since:
    Aug 2013

    Posted 11 Aug 2013 Link to this post

    I am also having the same issues in this scenario.  Has there been a resolution?

  7. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 13 Aug 2013 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017