TreeViewTagHelper
Kendo UI TreeView TagHelper TreeViewTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-treeview")]
[RestrictChildren("animation", new string[] { "checkboxes", "messages", "items", "hierarchical-datasource", "drag-and-drop", "item-template" })]
[OutputElementHint("div")]
public class TreeViewTagHelper : ItemsCollectionTagHelperBase, ITagHelper, ITagHelperComponent, IDataBoundWidget<HierarchicalDataSourceTagHelper>, ITemplateComponent
Inheritance: objectTagHelperTagHelperBaseItemsCollectionTagHelperBaseTreeViewTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-treeview name="treeview" drag-and-drop="true" datatextfield="Name">
<hierarchical-datasource>
<transport>
<read url="@Url.Action("ReadItems", "Treeview")"/>
</transport>
<schema>
<hierarchical-model id="id"></hierarchical-model>
</schema>
</hierarchical-datasource>
</kendo-treeview>
Child Tags
Constructors
Initializes a new instance of the TreeViewTagHelper 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; }
If set to true the widget will auto-scroll the containing element when the mouse/finger is close to the top/bottom of it.
public bool? AutoScroll { get; set; }
Binds a list of items to the TreeView
[HtmlAttributeName("bind-to")]
public IEnumerable<TreeViewItemBase> BindTo { get; set; }
Sets the field of the data item that provides the icon name of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.
[HtmlAttributeName("dataiconfield")]
public string[] DataIconField { get; set; }
Sets the field of the data item that provides the image URL of the TreeView nodes.
[HtmlAttributeName("dataimageurlfield")]
public string DataImageUrlField { get; set; }
Sets the field of the data item that provides the sprite CSS class of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.
[HtmlAttributeName("dataspritecssclassfield")]
public string DataSpriteCssClassField { get; set; }
Sets the field of the data item that provides the text content of the nodes. If an array, each level uses the field that is at the same index in the array, or the last item in the array.
[HtmlAttributeName("datatextfield")]
public string DataTextField { get; set; }
Sets the field of the data item that provides the link URL of the nodes.
[HtmlAttributeName("dataurlfield")]
public string DataUrlField { get; set; }
Disables (false) or enables (true) drag-and-drop of the nodes.
[HtmlAttributeName("drag-and-drop")]
public bool? DragAndDropEnabled { get; set; }
If set to true expands all nodes. Applicable when local data binding is used.
public bool ExpandAll { get; set; }
Indicates whether the child DataSources should be fetched lazily when parent groups get expanded. Setting this to false causes all child DataSources to be loaded at initialization time.
public bool? LoadOnDemand { get; set; }
The name of the JavaScript function that will handle the change event. Triggered when the selection has changed (either by the user or through the select method).
public string OnChange { get; set; }
The name of the JavaScript function that will handle the check event. Triggered after the user has checked or unchecked a checkbox. If checkChildren is true, the event is triggered after all checked states are updated. This event has been introduced in internal builds after 2014.2.828.
public string OnCheck { get; set; }
The name of the JavaScript function that will handle the collapse event. Triggered before a subgroup gets collapsed. Cancellable.
public string OnCollapse { get; set; }
The name of the JavaScript function that will handle the dataBound event. Triggered after the dataSource change event has been processed (adding/removing items);
public string OnDataBound { get; set; }
The name of the JavaScript function that will handle the drag event. Triggered while a node is being dragged.
public string OnDrag { get; set; }
The name of the JavaScript function that will handle the dragend event. Triggered after a node has been dropped.
public string OnDragend { get; set; }
The name of the JavaScript function that will handle the dragstart event. Triggered before the dragging of a node starts.
public string OnDragstart { get; set; }
The name of the JavaScript function that will handle the drop event. Triggered when a node is being dropped.
public string OnDrop { get; set; }
The name of the JavaScript function that will handle the expand event. Triggered before a subgroup gets expanded.
public string OnExpand { get; set; }
The name of the JavaScript function that will handle the kendoKeydown event. Triggered when the user presses a keyboard key while the TreeView is focused.
public string OnKendoKeydown { get; set; }
The name of the JavaScript function that will handle the loadCompleted event. This event triggers only when loadOnDemand is set to false - it indicates that all nodes that need to be loaded are ready and present as data items in the DataSource of the TreeView.
public string OnLoadCompleted { get; set; }
The name of the JavaScript function that will handle the navigate event. Triggered when the user moves the focus on another node
public string OnNavigate { get; set; }
The name of the JavaScript function that will handle the select event. Triggered when a node is being selected by the user. Cancellable.
public string OnSelect { get; set; }
Sets the size of the component.
public ComponentSize? Size { get; set; }
Template for rendering each node. This option expects the name of a JavaScript function that will be called to return the template.
public string TemplateHandler { get; set; }
Template for rendering each node. 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:
Template for rendering each node. This option expects the IHtmlContent instance containing the created HTML.
public IHtmlContent TemplateView { 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: