New to Telerik UI for ASP.NET MVC? Download free 30-day trial

EditorCustomButtonToolBuilder

Methods

Name(System.String)

Sets the name of the custom button tool.

Parameters

value - System.String

The name value.

Example


             @(Html.Kendo().Editor()
               .Name("Editor")
               .Tools(tools => tools
                    .CustomButton(x => x
                       .Name("custom")
                    )
               )   
             )

Exec(System.Func)

Sets a JavaScript function that will be executed when the end-user clicks the custom tool button.

Parameters

handler - System.Func<Object,Object>

The handler code wrapped in a text tag.

Example


             @(Html.Kendo().Editor()
               .Name("Editor")
               .Tools(tools => tools
                    .CustomButton(x => x
                       .Name("custom")
                       .Exec(@<text>
                           function(e) {
                               var editor = $(this).data("kendoEditor");
                               editor.exec("inserthtml", { value: "<hr />" });
                           }
                       </text>)
                    )
               )   
             )

Exec(System.String)

Sets a JavaScript function that will be executed when the end-user clicks the custom tool button.

Parameters

handler - System.String

The name of the JavaScript function that will be evaluated.

Example


             @(Html.Kendo().Editor()
               .Name("Editor")
               .Tools(tools => tools
                    .CustomButton(x => x
                       .Name("custom")
                       .Exec("insertRule")
                    )
               )   
             )
             <script>
                function insertRule(e) {
                    var editor = $(this).data("kendoEditor");
                    editor.exec("inserthtml", { value: "<hr />" });
                }
             </script>

ToolTip(System.String)

Sets the text that will be displayed when the end-user hovers the custom tool button.

Parameters

value - System.String

The text content.

Example


             @(Html.Kendo().Editor()
               .Name("Editor")
               .Tools(tools => tools
                    .CustomButton(x => x
                       .Name("custom")
                       .ToolTip("Insert a horizontal rule")
                    )
               )   
             )

Icon(System.String)

Specifies the icon that will be rendered for the tools.

Parameters

value - System.String

The value for Icon

In this article
Not finding the help you need?