I am trying to set textarea to be richtexteditor using jqte, the control works properly when I used it in popup dialog by setting it after open the popup like
function EditItemPopup(item) {
// Set Controls
//debugger;
ClearTips("validateTips");
ClearTips("DetailvalidateTips");
$.ajax({ type: "GET", url: BaseUrl + 'Get/?id=' + item.id })
.done(function (data) {
displayViewModelObject.item(data);
displayViewModelObject.dialogLoading(false);
SetOutComes();
SetTools();
$("#ddlUnits").val(displayViewModelObject.item().activity.unitID);
$("#ddlProjectTools").select2("val", displayViewModelObject.item().selectedActivityTools);
$("#ddlOutComes").select2("val", displayViewModelObject.item().selectedActivityOutComes);
$("#dialog").dialog(opt).dialog("open");
$('#Activity_Header').jqte();
$('#Activity_Footer').jqte();
$("#dialog").dialog(opt).dialog('option', 'width', BigDialogWidth);
$("#dialog").dialog(opt).dialog('option', 'height', BigDialogHeight);
$("#dialog").dialog(opt).keypress(function (e) { EnterKeyPress(e); });
Z_Index = 1;
// Set Validation
$.validator.unobtrusive.parse($("#frmManager"));
$('#frmManager').validate().resetForm();
$('.field-validation-error').empty();
EditInit();
}).fail(function () { ShowAlert(msgLoadError, -1); });
};
this function is called by knockout binding. and when I try to make the same thing but by js method called to open the poup in click event (without knockout binding), the jqte library creates an editor inside another in each calling open popup method which like the prev method.
Thanks