DiagramShapeDefaultsEditableSettingsToolButtonBuilder
Methods
HtmlAttributes(System.Object)
Specifies the HTML attributes of a ButtonGroup's button.
Parameters
value - System.Object
The value that configures the HTML attributes.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").HtmlAttributes(new { @class = "defaultBtn"});
})
))
)
)
HtmlAttributes(System.Collections.Generic.IDictionary)
Specifies the HTML attributes of a ButtonGroup's button.
Parameters
value - System.Collections.Generic.IDictionary<String,Object>
The value that configures the HTML attributes.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").HtmlAttributes(new Dictionary<string, object>() { ["class"] = "defaultBtn" });
})
))
)
)
Click(System.String)
Specifies the "click" event handler of the button within a ButtonGroup.
Parameters
value - System.String
The name of the JavaScript function that handles the "click" event.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Click("onItem1Click");
})
))
)
)
Enable(System.Boolean)
Specifies whether the ButtonGroup button must be initially enabled or disabled.
Parameters
value - System.Boolean
The value that configures the Enable option.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Enable(false);
})
))
)
)
Group(System.String)
Assigns the button to a group. The options is applicable only for the children of a ButtonGroup that has Togglable(true).
Parameters
value - System.String
The value that configures the group of the button.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Togglable(true).Group("group1");
btn.Add().Text("Item 2").Togglable(true).Group("group1");
})
))
)
)
Icon(System.String)
Sets an icon for the ButtonGroup button. The icon must be one of the existing in the Kendo UI theme sprite.
Parameters
value - System.String
The value that configures the icon.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Icon("clock");
})
))
)
)
Id(System.String)
Specifies the ID of the button within the ButtonGroup.
Parameters
value - System.String
The value that configures the id of the button.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Id("1");
})
))
)
)
ImageUrl(System.String)
Sets an image with a specified URL to be rendered in the button.
Parameters
value - System.String
The value that configures the image URL.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").ImageUrl("/diagram/settings.png");
})
))
)
)
Selected(System.Boolean)
Specifies if the toggle button must be initially selected. The option applies only to the children of the ButtonGroup that have Togglable(true).
Parameters
value - System.Boolean
The value that configures the selected button state.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Togglable(true).Selected(true);
})
))
)
)
ShowIcon(System.String)
Specifies where the icon of the button will be displayed. The supported values are: "toolbar", "overflow", and "both" (default).
Parameters
value - System.String
The value that configures the visibility of the button icon.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").ShowIcon("both");
})
))
)
)
ShowText(System.String)
Specifies where the text of the button will be displayed. The supported values are: "toolbar", "overflow", and "both" (default).
Parameters
value - System.String
The value that configures the visibility of the button text..
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").ShowText("both");
})
))
)
)
SpriteCssClass(System.String)
Defines a CSS class (or multiple classes separated by spaces) that will be used for the button's icon.
Parameters
value - System.String
The value that configures the CSS class.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Icon("check").SpriteCssClass("tick-icon");
})
))
)
)
Toggle(System.String)
Specifies the "toggle" event handler of the button. The option is applicable only for buttons with option Togglable(true).
Parameters
value - System.String
The name of the JavaScript function that handles the "toggle" event.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Togglable(true).Toggle("onToggleItem");
})
))
)
)
Togglable(System.Boolean)
Specifies whether the button must be togglable. For example, the button has a selected and unselected state.
Parameters
value - System.Boolean
The value that enables or disables the togglable option.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Togglable(true);
})
))
)
)
Text(System.String)
Specifies the text of the button.
Parameters
value - System.String
The value that configures the text.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1");
})
))
)
)
Url(System.String)
Specifies the URL of the button to navigate to.
Parameters
value - System.String
The value that configures the URL.
Example
@(Html.Kendo().Diagram()
.Name("diagram")
.ShapeDefaults(sd => sd
.Editable(e => e.Tools(tt => tt.Custom().Type("buttonGroup")
.Buttons(btn =>
{
btn.Add().Text("Item 1").Url("URL value");
})
))
)
)