TreeViewBuilder
Defines the fluent API for configuring the Kendo UI TreeView
Definition
Namespace:Kendo.Mvc.UI.Fluent
Assembly:Kendo.Mvc.dll
Syntax:
public class TreeViewBuilder : WidgetBuilderBase<TreeView, TreeViewBuilder>, IHtmlContent
Inheritance: objectHelperResultWidgetBuilderBase<TreeView, TreeViewBuilder>TreeViewBuilder
Implements:
Inherited Members
Constructors
Initializes a new instance of the TreeViewBuilder class.
Methods
Configures the animation effects of the widget.
public TreeViewBuilder Animation(Action<ExpandableAnimationBuilder> animationAction)
The action which configures the animation effects.
Returns:Returns the current TreeViewBuilder instance.
Use to enable or disable animation of the TreeView.
public TreeViewBuilder Animation(bool enable)
The boolean value.
Returns:Returns the current TreeViewBuilder instance.
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 TreeViewBuilder AutoBind(bool value)
The value for AutoBind
Returns:Returns the current TreeViewBuilder instance.
If set to true the widget will auto-scroll the containing element when the mouse/finger is close to the top/bottom of it.
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 TreeViewBuilder AutoScroll(bool value)
The value for AutoScroll
Returns:Returns the current TreeViewBuilder instance.
Binds the TreeView to a list of objects. The TreeView will create a hierarchy of items using the specified mappings.
public TreeViewBuilder BindTo(IEnumerable dataSource, Action<NavigationBindingFactory<TreeViewItem>> factoryAction)
The data source.
factoryActionAction<NavigationBindingFactory<TreeViewItem>>The action which will configure the mappings
Returns:Returns the current TreeViewBuilder instance.
Binds the TreeView to a list of items. Use if a hierarchy of items is being sent from the controller; to bind the TreeView declaratively, use the Items() method.
public TreeViewBuilder BindTo(IEnumerable<TreeViewItemModel> items)
The list of items
Returns:Returns the current TreeViewBuilder instance.
Binds the TreeView to a list of objects. The TreeView will be "flat" which means a TreeView item will be created for every item in the data source.
public TreeViewBuilder BindTo<T>(IEnumerable<T> dataSource, Action<TreeViewItem, T> itemDataBound)
The data source.
itemDataBoundAction<TreeViewItem, T>The action executed for every data bound item.
Returns:Returns the current TreeViewBuilder instance.
If true or an object, renders checkboxes beside each node.
public TreeViewBuilder Checkboxes()
Returns the current instance of TreeViewCheckboxesSettingsBuilder .
If true or an object, renders checkboxes beside each node.
public TreeViewBuilder Checkboxes(Action<TreeViewCheckboxesSettingsBuilder> configurator)
The TreeViewCheckboxesSettingsBuilder for the checkboxes setting.
Returns:Returns the current instance of TreeViewBuilder .
If true or an object, renders checkboxes beside each node.
public TreeViewBuilder Checkboxes(bool enabled)
Enables or disables the checkboxes option.
Returns:Returns the current instance of TreeViewCheckboxesSettingsBuilder .
Defines the template that renders the checkboxes in the TreeView. The available fields in the template are:
- item: The data item of the given node.
- treeview: The TreeView options.
public TreeViewBuilder CheckboxTemplate(string template)
The value that configures the checkbox template.
Returns:Returns the current TreeViewBuilder instance.
Defines the template that renders the checkboxes in the TreeView. The available fields in the template are:
- item: The data item of the given node.
- treeview: The TreeView options.
public TreeViewBuilder CheckboxTemplate<TModel>(TemplateBuilder<TModel> template)
A Template component that configures the checkbox template.
Returns:Returns the current TreeViewBuilder instance.
Defines the template that renders the checkboxes in the TreeView. The available fields in the template are:
- item: The data item of the given node.
- treeview: The TreeView options.
public TreeViewBuilder CheckboxTemplateHandler(string templateHandler)
he JavaScript function that will return the checkbox template.
Returns:Returns the current TreeViewBuilder instance.
Defines the template that renders the checkboxes in the TreeView. The available fields in the template are:
- item: The data item of the given node.
- treeview: The TreeView options.
public TreeViewBuilder CheckboxTemplateId(string templateId)
The "id" attribute of the external Kendo UI Template.
Returns:Returns the current TreeViewBuilder instance.
Defines the template that renders the checkboxes in the TreeView. The available fields in the template are:
- item: The data item of the given node.
- treeview: The TreeView options.
public TreeViewBuilder CheckboxTemplateView(IHtmlContent templateView)
The Razor View that contains the checkbox template.
Returns:Returns the current TreeViewBuilder instance.
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.
public TreeViewBuilder DataIconField(params string[] value)
The value for DataIconField
Returns:Returns the current TreeViewBuilder instance.
Sets the field of the data item that provides the image URL of the TreeView nodes.
public TreeViewBuilder DataImageUrlField(string value)
The value for DataImageUrlField
Returns:Returns the current TreeViewBuilder instance.
Configure the DataSource of the component
public TreeViewBuilder DataSource(Action<HierarchicalDataSourceBuilder<object>> configurator)
The HierarchicalDataSourceBuilder<TModel> that configures the DataSource of the component.
Returns:Returns the current TreeViewBuilder instance.
Set ID of the DataSource that to be used for data binding
public TreeViewBuilder DataSource(string dataSourceId)
Returns the current TreeViewBuilder instance.
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.
public TreeViewBuilder DataSpriteCssClassField(string value)
The value for DataSpriteCssClassField
Returns:Returns the current TreeViewBuilder instance.
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.
public TreeViewBuilder DataTextField(params string[] value)
The value for DataTextField
Returns:Returns the current TreeViewBuilder instance.
Sets the field of the data item that provides the link URL of the nodes.
public TreeViewBuilder DataUrlField(string value)
The value for DataUrlField
Returns:Returns the current TreeViewBuilder instance.
Disables (false) or enables (true) drag-and-drop of the nodes. If configured as an object allows disabling click move click interaction as an alternative of dragging.
public TreeViewBuilder DragAndDrop()
Returns the current instance of TreeViewDragAndDropSettingsBuilder .
Disables (false) or enables (true) drag-and-drop of the nodes. If configured as an object allows disabling click move click interaction as an alternative of dragging.
public TreeViewBuilder DragAndDrop(Action<TreeViewDragAndDropSettingsBuilder> configurator)
The TreeViewDragAndDropSettingsBuilder for the draganddrop setting.
Returns:Returns the current instance of TreeViewBuilder .
Disables (false) or enables (true) drag-and-drop of the nodes. If configured as an object allows disabling click move click interaction as an alternative of dragging.
public TreeViewBuilder DragAndDrop(bool enabled)
Enables or disables the draganddrop option.
Returns:Returns the current instance of TreeViewDragAndDropSettingsBuilder .
Configures the client-side events.
public TreeViewBuilder Events(Action<TreeViewEventBuilder> configurator)
The client events action.
Returns:Returns the current TreeViewBuilder instance.
Expand all the items.Applicable when local data binding is used.
public TreeViewBuilder ExpandAll(bool value)
If true all the items will be expanded.
Returns:Returns the current TreeViewBuilder instance.
Select item depending on the current URL.
public TreeViewBuilder HighlightPath(bool value)
If true the item will be highlighted.
Returns:Returns the current TreeViewBuilder instance.
Defines the items in the TreeView
public TreeViewBuilder Items(Action<TreeViewItemFactory> addAction)
The add action.
Returns:Returns the current TreeViewBuilder instance.
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 TreeViewBuilder LoadOnDemand(bool value)
The value for LoadOnDemand
Returns:Returns the current TreeViewBuilder instance.
The text messages displayed in the widget. Use it to customize or localize the messages.
public TreeViewBuilder Messages(Action<TreeViewMessagesSettingsBuilder> configurator)
The TreeViewMessagesSettingsBuilder for the messages setting.
Returns:Returns the current instance of TreeViewBuilder .
Sets the size of the component.
public TreeViewBuilder Size(ComponentSize value)
The value for Size
Returns:Returns the current TreeViewBuilder instance.
Template for rendering each node.
public TreeViewBuilder Template(string value)
The value for Template
Returns:Returns the current TreeViewBuilder instance.
Template for rendering each node.
public TreeViewBuilder Template<TModel>(TemplateBuilder<TModel> template)
A Template component that configures the template.
Returns:Returns the current TreeViewBuilder instance.
Template for rendering each node.
public TreeViewBuilder TemplateHandler(string templateHandler)
The handler that returs the template for Template
Returns:Returns the current TreeViewBuilder instance.
Template for rendering each node.
public TreeViewBuilder TemplateId(string templateId)
The ID of the template element for Template
Returns:Returns the current TreeViewBuilder instance.
Template for rendering each node.
public TreeViewBuilder TemplateView(IHtmlContent templateView)
The view that contains the template for Template
Returns:Returns the current TreeViewBuilder instance.