DiagramTagHelper
Kendo UI Diagram TagHelper DiagramTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-diagram")]
[RestrictChildren("connection-defaults", new string[] { "connections", "editable", "layout", "pannable", "pdf", "selectable", "shape-defaults", "shapes", "hierarchical-datasource", "connections-datasource", "shape-template", "tooltip", "accessibility", "navigatable" })]
public class DiagramTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, IDataBoundWidget<HierarchicalDataSourceTagHelper>, ITemplateComponent
Inheritance: objectTagHelperTagHelperBaseDiagramTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-diagram name="diagram">
<hierarchical-datasource server-operation="false">
<transport>
<read url="@Url.Action("_OrgChart", "Diagram")" />
</transport>
<schema>
<hierarchical-model children="Items"></hierarchical-model>
</schema>
</hierarchical-datasource>
<editable enabled="false" />
<layout type="DiagramLayoutType.Layered"></layout>
</kendo-diagram>
Child Tags
Constructors
Initializes a new instance of the DiagramTagHelper class.
Properties
If set to false the widget will not bind to the data source during initialization. In this case data binding will occur when the change event of the data source is fired. By default the widget will bind to the data source specified in the configuration.
public bool? AutoBind { get; set; }
The data source id
public string DatasourceId { get; set; }
The name of the JavaScript function that will handle the add event. Fired when the user adds new shape or connection.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnAdd { get; set; }
The name of the JavaScript function that will handle the cancel event. Fired when the user clicks the "cancel" button in the popup window in case the item was added via a toolbar.
public string OnCancel { get; set; }
The name of the JavaScript function that will handle the change event. Fired when an item is added or removed to/from the diagram.
public string OnChange { get; set; }
The name of the JavaScript function that will handle the click event. Fired when the user clicks on a shape or a connection.
public string OnClick { get; set; }
The name of the JavaScript function that will handle the dataBound event. Fired when the widget is bound to data from dataDource and connectionsDataSource.The event handler function context (available via the this keyword) will be set to the widget instance.
public string OnDataBound { get; set; }
The name of the JavaScript function that will handle the drag event. Fired when dragging shapes or connection.
public string OnDrag { get; set; }
The name of the JavaScript function that will handle the dragEnd event. Fired after finishing dragging shapes or connection.
public string OnDragEnd { get; set; }
The name of the JavaScript function that will handle the dragStart event. Fired before starting dragging shapes or connection.
public string OnDragStart { get; set; }
The name of the JavaScript function that will handle the edit event. Fired when the user edits a shape or connection.
public string OnEdit { get; set; }
The name of the JavaScript function that will handle the itemBoundsChange event. Fired when the location or size of a shape are changed.
public string OnItemBoundsChange { get; set; }
The name of the JavaScript function that will handle the itemRotate event. Fired when a shape is rotated.
public string OnItemRotate { get; set; }
The name of the JavaScript function that will handle the mouseEnter event. Fired when the mouse enters a shape or a connection.Will not fire for disabled items.
public string OnMouseEnter { get; set; }
The name of the JavaScript function that will handle the mouseLeave event. Fired when the mouse leaves a shape or a connection.Will not fire for disabled items.
public string OnMouseLeave { get; set; }
The name of the JavaScript function that will handle the pan event. Fired when the user pans the diagram.
public string OnPan { get; set; }
The name of the JavaScript function that will handle the remove event. Fired when the user removes a shape or connection.
public string OnRemove { get; set; }
The name of the JavaScript function that will handle the save event. Fired when the user saves a shape or a connection.
public string OnSave { get; set; }
The name of the JavaScript function that will handle the select event. Fired when the user selects one or more items.
public string OnSelect { get; set; }
The name of the JavaScript function that will handle the toolBarClick event. Fired when the user clicks an item in the toolbar.
public string OnToolBarClick { get; set; }
The name of the JavaScript function that will handle the zoomEnd event. Fired when the user changes the diagram zoom level.
public string OnZoomEnd { get; set; }
The name of the JavaScript function that will handle the zoomStart event. Fired when the user starts changing the diagram zoom level.
public string OnZoomStart { get; set; }
The tabIndex value to set on the diagram element.
public double? TabIndex { get; set; }
The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below.
public string Template { get; set; }
The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below. This option expects the name of a JavaScript function that will be called to return the template.
public string TemplateHandler { get; set; }
The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below. This option expects the ID of the script element that contains the template.
public string TemplateId { get; set; }
Represents a collection of templates defined for the component.
[HtmlAttributeNotBound]
public IDictionary<string, string> Templates { get; }
Implements:
The template which renders the content of the shape when bound to a dataSource. The names you can use in the template correspond to the properties used in the dataSource. For an example, refer to the dataSource topic below. This option expects the IHtmlContent instance containing the created HTML.
public IHtmlContent TemplateView { get; set; }
The diagram theme. With versions prior to R1 2023 this can be either the respective LESS theme from the list below or "sass". When set to "sass" the diagram will read the variables from a Sass-based theme.Note: Since Q2 2024 release, the default value for the theme property is "sass" instead of "default". It is recommended to use "sass" with version Q2 2024 or later.The supported values are: * "sass" * "black" * "blueopal" * "bootstrap" * "bootstrap-v4" - works only with the Bootstrap-v4 Sass theme loaded in the page * "default" * "default-v2" - works only with the Default-v2 Sass theme loaded in the page * "fiori" * "flat" * "highcontrast" * "material" * "materialBlack" * "metro" * "metroblack" * "moonlight" * "nova" * "office365" * "silver" * "uniform"
public string Theme { get; set; }
The default zoom level of the Diagram in percentages.
public double? Zoom { get; set; }
The maximum zoom level in percentages. The user will not be allowed to zoom in past this level.
public double? ZoomMax { get; set; }
The minimum zoom level in percentages. The user will not be allowed to zoom out past this level. You can see an example in zoomMax.
public double? ZoomMin { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: