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

Provides a fluent interface for configuring custom button tools in the Editor.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class EditorCustomButtonToolBuilder

Inheritance: objectEditorCustomButtonToolBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public EditorCustomButtonToolBuilder(EditorCustomButtonTool tool)
Parameters:toolEditorCustomButtonTool

Methods

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

C#
public EditorCustomButtonToolBuilder Exec(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag.

Returns:

EditorCustomButtonToolBuilder

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

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

C#
public EditorCustomButtonToolBuilder Exec(string handler)
Parameters:handlerstring

The name of the JavaScript function that will be evaluated.

Returns:

EditorCustomButtonToolBuilder

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

Specifies the icon that will be rendered for the tools.

C#
public EditorCustomButtonToolBuilder Icon(string value)
Parameters:valuestring

The value for Icon

Returns:

EditorCustomButtonToolBuilder

Sets the name of the custom button tool.

C#
public EditorCustomButtonToolBuilder Name(string value)
Parameters:valuestring

The name value.

Returns:

EditorCustomButtonToolBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Tools(tools =&gt; tools
.CustomButton(x =&gt; x
.Name("custom")
)
)
)

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

C#
public EditorCustomButtonToolBuilder ToolTip(string value)
Parameters:valuestring

The text content.

Returns:

EditorCustomButtonToolBuilder

Example:
C#
@(Html.Kendo().Editor()
.Name("Editor")
.Tools(tools =&gt; tools
.CustomButton(x =&gt; x
.Name("custom")
.ToolTip("Insert a horizontal rule")
)
)
)