TreeViewBuilder
Defines the fluent interface for configuring the TreeView component.
Definition
Namespace:Kendo.Mvc.UI.Fluent
Assembly:Kendo.Mvc.dll
Syntax:
public class TreeViewBuilder : WidgetBuilderBase<TreeView, TreeViewBuilder>, IHtmlString
Inheritance: objectWidgetBuilderBase<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:Use to enable or disable animation of the TreeView.
Controls whether to bind the widget to the DataSource on initialization.
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 that configures the autoscroll.
Returns: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: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:Binds the TreeView to a sitemap
public TreeViewBuilder BindTo(string viewDataKey, Action<TreeViewItem, SiteMapNode> siteMapAction)
The view data key.
siteMapActionAction<TreeViewItem, SiteMapNode>The action to configure the item.
Returns:Binds the TreeView to a sitemap.
public TreeViewBuilder BindTo(string viewDataKey)
The view data key.
Returns: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:Configures the rendering of the checkboxes in the TreeView.
public TreeViewBuilder Checkboxes(Action<TreeViewCheckboxesBuilder> configure)
The action that configures the checkboxes settings.
Returns:Enables or disables the rendering of the checkboxes in the TreeView.
public TreeViewBuilder Checkboxes(bool enabled)
A boolean value that toggles the rendering of the checkboxes.
Returns: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: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: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 template)
The JavaScript function that will return the checkbox template.
Returns: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: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(MvcHtmlString template)
The Razor View that contains the checkbox template.
Returns: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 that configures the dataiconfield.
Returns:Sets the field of the data item that provides the image URL of the TreeView nodes.
public TreeViewBuilder DataImageUrlField(string value)
The value that configures the dataimageurlfield.
Returns:Configure the DataSource of the component
public TreeViewBuilder DataSource(Action<HierarchicalDataSourceBuilder<object>> configurator)
The action that configures the DataSource.
Returns: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 that configures the dataspritecssclassfield.
Returns: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 that configures the datatextfield.
Returns:Sets the field of the data item that provides the link URL of the nodes.
public TreeViewBuilder DataUrlField(string value)
The value that configures the dataurlfield.
Returns:Allows disabling click move click interaction as an alternative of dragging. Disables (false) or enables (true) the click move click interaction as an alternative of dragging. The alternative is disabled by default.
public TreeViewBuilder DragAndDrop(Action<TreeViewDragAndDropBuilder> configure)
Builder of the treeview drag & drop configuration.
Returns: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 value)
If true, drag & drop is enabled.
Returns:Configures the client-side events.
public TreeViewBuilder Events(Action<TreeViewEventBuilder> clientEventsAction)
The client events action.
Returns:Expand all the items.
public TreeViewBuilder ExpandAll(bool value)
If true all the items will be expanded.
Returns:Select item depending on the current URL.
public TreeViewBuilder HighlightPath(bool value)
If true the item will be highlighted.
Returns:Callback for each item.
public TreeViewBuilder ItemAction(Action<TreeViewItem> action)
Action, which will be executed for each item.
Returns:Defines the items in the TreeView
public TreeViewBuilder Items(Action<TreeViewItemFactory> addAction)
The add action.
Returns:Allows the treeview to fetch the entire datasource at initialization time.
public TreeViewBuilder LoadOnDemand(bool value)
Whether the datasource should be loaded on demand.
Returns:The text messages displayed in the widget. Use it to customize or localize the messages.
public TreeViewBuilder Messages(Action<TreeViewMessagesSettingsBuilder> configurator)
The action that configures the messages.
Returns:Defines the security trimming functionality of the component
public TreeViewBuilder SecurityTrimming(Action<SecurityTrimmingBuilder> securityTrimmingAction)
The securityTrimming action.
Returns:Enable/disable security trimming functionality of the component.
public TreeViewBuilder SecurityTrimming(bool value)
If true security trimming is enabled.
Returns:Sets the size of the component.
public TreeViewBuilder Size(ComponentSize value)
The value that configures the size.
Returns:Defines the template for rendering each TreeView node.
public TreeViewBuilder Template(string template)
The value that configures the node template.
Returns:Defines the template for rendering each TreeView node.
public TreeViewBuilder Template<TModel>(TemplateBuilder<TModel> template)
A Template component that configures the node template.
Returns:Defines the template for rendering each TreeView node.
public TreeViewBuilder TemplateHandler(string template)
The JavaScript function that will return the template content.
Returns:Defines the template for rendering each TreeView node.
public TreeViewBuilder TemplateId(string templateId)
The "id" attribute of the external Kendo UI Template.
Returns:Defines the template for rendering each TreeView node.
public TreeViewBuilder TemplateView(MvcHtmlString template)
The Razor View that contains the node template.
Returns: