How override Print in Kendo UI Editor?

1.1k views Asked by At

I used Kendo UI Editor control. IT is ok. But I need to do same events before Printing How override Print function in Kendo UI Editor ?

 @(Html.Kendo().Editor()
      .Name("editor")
      .Tools(tools => tools
          .Clear()
          .Bold().Italic().Underline().Strikethrough()
          .JustifyLeft().JustifyCenter().JustifyRight().JustifyFull()
          .InsertUnorderedList().InsertOrderedList()
          .Outdent().Indent()
          .CreateLink().Unlink()
          .InsertImage()
          .InsertFile()
          .SubScript()
          .SuperScript()
          .TableEditing()
          .ViewHtml()
          .Formatting()
          .CleanFormatting()
          .FontName()
          .FontSize()
          .FontColor().BackColor()
          .Print())

      )</div>

I would like to override Print option

1

There are 1 answers

0
Robin Giltner On BEST ANSWER

You can create a custom button in the tool bar (http://demos.telerik.com/kendo-ui/editor/custom-tools) with something like

.CustomButton(cb => cb.Name("Custom Primt").ToolTip("Do stuff then Print").Exec(@<text>
        function(e) {
            var editor = $(this).data("kendoEditor");
            editor.exec("inserthtml", { value: "Printing this document..." });
            editor.exec("print");
        }

Which will add "Printing this document..." to the editor body, then call the Print function on the editor.