TreeViewComponent
Represents the Kendo UI TreeView component for Angular.
Definition
Package:@progress/kendo-angular-treeview
Selector:kendo-treeview
Export Name:Accessible in templates as #kendoTreeViewInstance="kendoTreeView"
Syntax:
<kendo-treeview
kendoTreeViewExpandable
[nodes]="data"
textField="text"
[children]="fetchChildren"
[hasChildren]="hasChildren">
</kendo-treeview>
Inputs
animate
boolean
Enables or disables content animation.
A function that provides the child nodes for a given parent node (see example).
Observable<object[]>
disableParentNodesOnly
boolean
Indicates whether only parent nodes should be disabled or their child nodes as well.
false
expandDisabledNodes
boolean
Allows expanding disabled nodes.
false
filter
string
Sets the initial value of the built-in filter input.
''
filterable
boolean
Renders the built-in input element for filtering. If true, emits the filterChange event that can be handled for manual filtering.
Built-in filtering is available with kendoTreeViewHierarchyBinding and kendoTreeViewFlatDataBinding directives.
false
filterInputPlaceholder
string
Sets the placeholder text for the filter input when the component is empty.
""
A function that determines if a node has a checkbox. If there is no checkbox, the node is not checkable and is excluded from built-in check functionality.
boolean
hasCheckbox
hasChildren
(item: object) => boolean
A function that determines if a node has child nodes (see example).
isChecked
(item: object, index: string) => CheckedState
A function that determines if a node is checked (see example).
A function that determines if a node is disabled.
boolean
isDisabled
isExpanded
(item: object, index: string) => boolean
A function that determines if a node is expanded.
isSelected
(item: object, index: string) => boolean
A function that determines if a node is selected (see example).
A callback that determines whether a TreeView node should be rendered as hidden. Uses the .k-hidden utility class. Useful for custom filtering.
boolean
isVisible
loadOnDemand
boolean
Indicates whether child nodes are fetched on expand or initally prefetched.
true
navigable
boolean
Enables keyboard navigation for the TreeView.
true
nodes
any[]
The nodes displayed by the TreeView (see example).
Sets the size of the component.
undefined
textField
string | string[]
The fields of the data item that provide the text content of the nodes (see example). If set to an array, each level uses the field at the same index or the last item in the array.
trackBy
TrackByFunction<object>
A function that defines how to track node changes. By default, the TreeView tracks the nodes by data item object reference.
trackBy
Events
Fires after a dragged item is dropped (see example). Called on the TreeView where the item is dropped.
blur
EventEmitter<any>
Fires when the component loses focus.
Fires when a TreeView node checkbox is selected (see example).
childrenLoaded
EventEmitter<{ children: TreeItem[]; item: TreeItem }>
Fires when the children of the expanded node are loaded.
Fires when a TreeView node collapses.
Fires when a TreeView node expands.
filterChange
EventEmitter<string>
Fires when the value of the built-in filter input changes.
Emits when the built-in filtering mechanism updates node visibility. Used for the built-in auto-expand functionalities. Handle this event for custom implementations.
focus
EventEmitter<any>
Fires when the component receives focus.
Fires when a TreeView node is clicked.
Fires when a TreeView node is double-clicked.
Fires when an item is being dragged (see example).
Fires on the source TreeView after the dragged item is dropped (see example).
Fires just before node dragging starts (see example). This event is preventable. Prevent the default event to stop drag hint creation and further drag events.
Fires on the target TreeView when a dragged item is dropped (see example).
Prevent the default event (event.preventDefault()) or set the event as invalid (event.setValid(false)) to stop the addItem and removeItem events from triggering.
Use preventDefault to handle add/remove manually, or setValid(false) to indicate an unsuccessful operation. While setValid(false) animates the drag clue to its original position, event.preventDefault() simply removes the clue.
Fires after a dragged item is dropped (see example). Called on the TreeView from where the item is dragged.
Fires when a TreeView node is selected (see example).
Methods
Blurs the focused TreeView item.
Triggers the collapse event for the provided node.
Triggers the expand event for the provided node and shows its loading indicator.
Focuses the first focusable item in the TreeView if no hierarchical index is provided.
Gets the current page size of the data item's children collection (see example).
Pass null as dataItem to get the root collection's page size.
{any} - The parent data item of the targeted collection.
Returns:number
- The page size of the data item's children collection.
Returns the TreeItemLookup node for the specified index.
Calls the children function for every expanded node and fetches all rendered child nodes again.
Sets the page size of the data item's children collection (see example).
Pass null as dataItem to set the root collection's page size.
{any} - The parent data item of the targeted collection.
pageSizenumber{number} - The new page size.