【问题标题】:Kendo UI Editor - Remove a specific tool from editor-menuKendo UI Editor - 从编辑器菜单中删除特定工具
【发布时间】:2013-06-20 15:14:15
【问题描述】:

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

其实我只是想从Kendo Editor(all tools)控件中移除Insert image按钮。

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

有什么想法吗?

【问题讨论】:

    标签: kendo-ui kendo-asp.net-mvc


    【解决方案1】:

    知道了。需要先把所有的工具都去掉,然后再一个一个地添加每个工具。有一个方法 Clear() 。这是代码。

    @(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()
    )
    

    如果有其他方法,请告诉我。

    【讨论】:

    • 某处缺少括号。怀疑它属于ViewHtml()之后,否则,非常有帮助的答案!
    【解决方案2】:

    删除特定或所有工具的另一种方法是使用 jquery,类似这样 -

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

    这里是Demo JS Fiddle

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多