6

如何从 Kendo Editor 控件中删除特定工具/按钮?

实际上,我只想从Kendo Editor(所有工具)控件中删除Insert image按钮。

@(Html.Kendo().Editor()
  .Name("editor")
  .Tools(tools => tools.SubScript().SuperScript().ViewHtml())
)

有任何想法吗?

4

2 回答 2

9

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.

于 2013-06-24T08:03:12.943 回答
2

删除特定或所有工具的另一种方法是使用 jquery,如下所示 -

<script>

    $(document).ready(function() {
        $("#editor").kendoEditor({
            value: "<p>hello there...</p>",
            tools: []
        });
    });

</script>

这是演示 JS Fiddle

于 2014-09-02T16:45:11.767 回答