RadEditor and Jquery Dialog

5 posts, 1 answers
  1. Gabriel Castillo
    Gabriel Castillo avatar
    9 posts
    Member since:
    Jul 2009

    Posted 08 Feb 2010 Link to this post

    Hi:
    I am trying to use rad editor inside jquery dialog, but for one reason the editor looks to be disabled, I mean I am not able to type anything on it.

    This is the code I am using:

     <script type="text/javascript">

                $(function() {
                    // Dialog            
                    $('#dialog').dialog({
                        autoOpen: false,
                        resizable: false,
                        width: 400
                    });
             
                });

    </script>  

    ...

    <div id="dialog" title="Pharmacist's Comments" class="modal">                                            
        <telerik:RadEditor ID="RadEditor1" runat="server"  Width="100%" Height="300" >
        </telerik:RadEditor>                                                    
        <asp:TextBox runat="server" ID="txtTest1"  />
    </div>   



    Also, Is it possible when resizing the dialog the radeditor adjust its height and width accordingly?

    Regards,
    Gabriel

  2. Gabriel Castillo
    Gabriel Castillo avatar
    9 posts
    Member since:
    Jul 2009

    Posted 09 Feb 2010 Link to this post

    I have just realized that when I set autoOpen: true on the dialog, the RadEditor works well, but It will open the dialog as soon as the page loads, I need the user to click on a link to open the dialog.

  3. Dobromir
    Admin
    Dobromir avatar
    1628 posts
    Member since:
    Sep 2012

    Posted 09 Feb 2010 Link to this post

    Hi Gabriel,

    The problem occurs because the jQuery dialog is moving the RadEditor's element in the DOM and this causes the editor to lose its content or become uneditable. In order to fix this you have to fire the client-side method onParentNodeChanged() after the dialog('open') method.
    Unfortunately, this does not solve this issue for Opera but we will do our best to fix this for one of the upcoming releases.

    Regards,
    Dobromir
    the Telerik team


    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.

  4. Gabriel Castillo
    Gabriel Castillo avatar
    9 posts
    Member since:
    Jul 2009

    Posted 10 Feb 2010 Link to this post

    Hi Dobromir,

    Thanks for your reply, but Can you send me a code snippet of how to call that method you are describing? onParentNodeChanged(), what do I have to do when calling that method?

    Regards,
    Gabriel


  5. Answer
    Dobromir
    Admin
    Dobromir avatar
    1628 posts
    Member since:
    Sep 2012

    Posted 10 Feb 2010 Link to this post

    Hi Gabriel,

    I believe you are displaying the dialog by clicking on a link/button and you are calling $("#dialog").dialog('open'), so onParentNodeChanged() should be called right after that, e.g.:

    $('#ShowDialog').click(function(event)
    {
        //show dialog
        $("#dialog").dialog('open');
        setTimeout(function()
        {
            $find("<%=RadEditor1.ClientID%>").onParentNodeChanged();
        }, 10);
    });
     
    For your convenience I have attached a sample project that demonstrates this.

    Greetings,
    Dobromir
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.

Back to Top