如何在Kendo UI Editor中覆盖打印?

时间:2015-06-11 13:09:28

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

我使用了Kendo UI Editor控件。没关系。 但是我需要在打印之前做同样的事情 如何在Kendo UI Editor中覆盖Print功能?

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

我想覆盖打印选项

1 个答案:

答案 0 :(得分:2)

您可以使用类似

的工具栏(http://demos.telerik.com/kendo-ui/editor/custom-tools)创建自定义按钮
.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");
        }

将添加&#34;打印此文档...&#34;到编辑器主体,然后在编辑器上调用Print函数。