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

content does not appear in Rad Editor with popup dialog

1 Answer 120 Views
Editor
This is a migrated thread and some comments may be shown as answers.
kamini
Top achievements
Rank 1
kamini asked on 05 Feb 2014, 05:41 AM
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





















1 Answer, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 05 Feb 2014, 01:36 PM
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.
Tags
Editor
Asked by
kamini
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Share this question
or