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