|
<ejs-richtexteditor [(ngModel)]='contentDOC' [(value)]='contentDOC' >
</ejs-richtexteditor> |
|
public ontoolbarClick(rte: RichTextEditor) {
if (rte.imageModule.dialogObj) {
rte.imageModule.dialogObj.isModal = true;
}
} |
Hi Lorryl,
Thank you for your update.
We could not replicate the reported console error when using both ngModel and value binding. Kindly provide additional information on the issue. you can enable the image dialog fully by using the toolbar click event and setting isModal as true in the disalog’s instance
public ontoolbarClick(rte: RichTextEditor) {if (rte.imageModule.dialogObj) {rte.imageModule.dialogObj.isModal = true;}}
Regards,Prince
|
<div>
<div>@Html.EJS().RichTextEditor("default").Value((string)ViewBag.value).Render()</div>
<div> <button id="btn">save content</button></div>
</div>
<script>
document.getElementById('btn').addEventListener('click', function () {
var obj = document.getElementById('default').ej2_instances[0];
var value = JSON.stringify({ text: obj.value });
const Http = new XMLHttpRequest();
const url = '@Url.Action("Save")';
Http.open("POST", url);
Http.setRequestHeader('Content-Type', 'application/json');
Http.send(value);
});
</script> |
|
[HttpPost]
public ActionResult Save(string text)
{
string RootPath = Server.MapPath("~/data.txt");
StreamWriter wirteFile = new StreamWriter(RootPath, true);
wirteFile.WriteLine(text);
wirteFile.Close();
wirteFile.Dispose();
return View("Index");
} |
|
|