5

How can I add Custom tools to kendo editor toolbar?

I want to add spell checker, Media manager and Cut,Copy , Paste, and cut from word, copy from word and some more tools also.

I am using Kendo editor in MVC application.

Cœur
  • 37,241
  • 25
  • 195
  • 267
vijesh
  • 1,115
  • 1
  • 11
  • 27

1 Answers1

4

I am using a custom tool for adding a link references within the application by searching them from the already existing ones.

Here you are a code snipped from my source

@(Html.Kendo()
                  .Editor()
                  .Name("Content")
                  .Tools(tools => tools
                      .Clear()
                      .Bold().Italic().Underline().Strikethrough()
                      .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
                      .InsertUnorderedList().InsertOrderedList()
                      .Outdent().Indent()
                      .CreateLink().Unlink()
                      .InsertImage()
                      .SubScript()
                      .SuperScript()
                      .TableEditing()
                      .ViewHtml()
                      .Formatting()
                      .CleanFormatting()
                      .FontName()
                      .FontSize()
                      .FontColor()
                      .BackColor()
                      .CustomButton(cb => cb
                          .Name("Add link to article")
                          .ToolTip("Add link to article")
                          .Exec("execFunction")
                      ))
                      .Encode(false)
                      .ImageBrowser(imageBrowser => imageBrowser
                             .Image("~/Content/Uploads/Images/{0}")
                             .Read("Read", "ImageBrowser")
                             .Create("Create", "ImageBrowser")
                             .Upload("Upload", "ImageBrowser")
                             .Thumbnail("Thumbnail", "ImageBrowser")))

So these are my configurations for the editor. I think you are interested only from .CustomButton(cb => cb.Name / this is necessary/ cb.Exec / also neccesary /. In Exec, you pass the name of your JS function that should be executed when the button is clicked. You can connect your JS than with ajax to your controllers. I will share you mine.

function execFunction(e) {
        $.get('/Articles/BuildLinkView', null, function(data) {
            $('#addLinkHolder').html(data);
            $('#addLinkHolder').css('display', 'table-cell');
        });
    }

Than you can do whatever you wish with it when you bind it to the controller.

I hope that this solves you issue. If not, please provide additional info

A.Sideris
  • 530
  • 3
  • 18
  • 1
    PS: I think that kendo has build in spellchecker and you can simply turn it on – A.Sideris Mar 21 '16 at 11:54
  • No, it does not have a spellchecker and it has been declined more than once ... https://feedback.telerik.com/kendo-jquery-ui/1358507-add-spell-check-to-kendo-ui-editors – MCS Jul 08 '20 at 09:52