content does not appear in Rad Editor with popup dialog

2 posts, 0 answers
  1. kamini
    kamini avatar
    32 posts
    Member since:
    Jun 2010

    Posted 04 Feb 2014 Link to this post

    Hi there,

    I have put Rad Editor inside <div> which gets pop up clicking on hyperlink using jquery dialog. When this dialog gets appear, once the content reflected for a while in Editor but within a few seconds, it gets disappear. Its a kind of very weird issue. 

    Can anyone give me a solution ASAP. 

    Here is my code.

    <div class="previewDialog" title="Email Preview" style="display: none; width: 750px; height: 400px;">
           <telerik:RadEditor runat="server" ID="emailPreview" EditModes="Preview" Width="95%" Height="170px" ToolbarMode="ShowOnFocus">
                            <CssFiles>   
                                <telerik:EditorCssFile Value="" />    
                            </CssFiles>
            </telerik:RadEditor>
    </div>

    <a id="previewLink" onclick="OpenPopupForPreviewEmail();">Preview</a>

    <script type="text/javascript" >
    function OpenPopupForPreviewEmail() {

    jqPoupDialog(".previewDialog");

    }
    function jqPoupDialog(dialogId) {
    if (!jQuery.fn.dialog) return;

    var $dialog = jQuery(dialogId).not(".converted");
    if ($dialog.length > 0) {
    $dialog.each(function () {
    var $this = jQuery(this);
    var dialogWidth = 400;
    var dialogHeight = 300;
    var dialogClass = "dialogWapper darkDialog";
    var escapeKeySupport = true;
    if ($this.hasClass("noClose")) {
    dialogClass = "dialogWapper noClose";
    escapeKeySupport = false;
    }
    if ($this.hasClass("disableEscapeSupport")) {
    escapeKeySupport = false;
    }
    if (this.style.width > 0 || this.style.width !== "")
    dialogWidth = parseInt(this.style.width);
    if (this.style.height > 0 || this.style.height !== "")
    dialogHeight = parseInt(this.style.height);
    if ($this.hasClass("ui-dialog-content")) {
    $this.dialog("open");
    } else {
    $this.dialog({
    autoOpen: true,
    width: dialogWidth,
    height: dialogHeight,
    modal: true,
    closeText: "",
    closeOnEscape: escapeKeySupport,
    dialogClass: dialogClass
    });

    $this.attr({ "id": "bsbWrapper" });
    }

    var editor = $find("<%= emailPreview.ClientID %>");
    editor.set_html("Test email preview");
    editor.setFocus(); 

    });
    }
    }
    </script>

    Thanks
    Kamini





















  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    5512 posts

    Posted 05 Feb 2014 Link to this post

    Hi Kamini,

    Could you try calling the editor's onParentNodeChanged() method as adivsed here: http://www.telerik.com/help/aspnet-ajax/window-troubleshooting-radeditor-in-radwindow.html.
    var editor = $find("<%= emailPreview.ClientID %>");
    editor.set_html("Test email preview");
    editor.onParentNodeChanged(); // you can try replacing it with repaint() if it does not help
    editor.setFocus();


    You can also consider using a RadWindow instead of the other dialog you are using right now.

    Regards,
    Marin Bratanov
    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 UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top