如何从 Kendo Editor 控件中删除特定工具/按钮?
实际上,我只想从Kendo Editor(所有工具)控件中删除Insert image
按钮。
@(Html.Kendo().Editor()
.Name("editor")
.Tools(tools => tools.SubScript().SuperScript().ViewHtml())
)
有任何想法吗?
如何从 Kendo Editor 控件中删除特定工具/按钮?
实际上,我只想从Kendo Editor(所有工具)控件中删除Insert image
按钮。
@(Html.Kendo().Editor()
.Name("editor")
.Tools(tools => tools.SubScript().SuperScript().ViewHtml())
)
有任何想法吗?
Got it. Need to remove all the tools first of all, and then add each tool one by one. There is a method Clear()
for it. Here is the code.
@(Html.Kendo().Editor()
.Name(name)
.Tools(tools => tools.Clear() //remove all tools
.Bold().Italic().Underline().Strikethrough()
.FontName().FontSize().FontColor().BackColor()
.JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
.InsertUnorderedList().InsertOrderedList().Indent().Outdent()
.FormatBlock().CreateLink().Unlink()
.SubScript().SuperScript().ViewHtml()
)
Please let me know if there is any other way of doing this.
删除特定或所有工具的另一种方法是使用 jquery,如下所示 -
<script>
$(document).ready(function() {
$("#editor").kendoEditor({
value: "<p>hello there...</p>",
tools: []
});
});
</script>