I have a Kendo Editor defined as below:
@(Html.Kendo().Editor()
.Name("editor")
.Tag("div")
.Tools(tools => tools
.Clear()
.Bold().Italic().Underline().Strikethrough()
.JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
.CreateLink().Unlink()
.InsertImage()
.TableEditing()
.FontColor().BackColor()
)
.Value(@<text>
<p> You are inside the editor. And in the editor there are some
anchor tags.
</p>
I want to make this editor as readonly and the anchor tags inside the editor as clickable.
I wrote the below Javascript code to achieve this behavior. And even followed the answers provided in similar posts on google search and in stackoverflow also. But none is working and editor is not Readonly. I can still edit.
Below is the code I tried:
<script>
var editor = $('#editor').data("kendoEditor"),
editorBody = $(editor.body);
// make readonly
editorBody.removeAttr("contenteditable").find("a").on("click.readonly", false);
</script>
Please suggest where I am going wrong and how can I achieve this behavior.
TIA for your help!