Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo UI Editor - Remove a specific tool from editor-menu

How can I remove a specific tool/button from Kendo Editor control?

Actually, I just want to remove Insert image button from Kendo Editor(all tools) control.

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

Any ideas?

like image 520
Paritosh Avatar asked Jun 24 '13 07:06

Paritosh


People also ask

How do I hide the toolbar in kendo editor?

attr('contenteditable', false);

What is Kendo UI widgets?

Kendo UI is a bundle of four JavaScript UI libraries built natively for jQuery, Angular, React and Vue. Each is built with consistent API and theming, so no matter what you choose, your UI will be modern, responsive, accessible and fast.

Is Kendo UI for angular open source?

About Kendo UI CoreKendo UI Core is the free and open-source version of Kendo UI that provides access to the web's best UI widgets and key framework features, essential for developing great experiences for the web and mobile.

What is Kendo UI for jQuery?

Kendo UI is a comprehensive HTML5 user interface framework for building interactive and high-performance websites and applications. It comes with a library of 110+ UI components, an abundance of data-visualization gadgets, client-side data source, and a built-in MVVM (Model-View-ViewModel) library.


2 Answers

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.

like image 93
Paritosh Avatar answered Oct 12 '22 10:10

Paritosh


The other way to remove the specific or all tools is by using jquery, something like this -

<script>

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

</script>

and here is the Demo JS Fiddle

like image 23
Krishnraj Rana Avatar answered Oct 12 '22 10:10

Krishnraj Rana