The tree allows users to represent hierarchical data in a tree-view structure, maintaining parent-child relationships, as well as to define static tree-view structure without a corresponding data model.
- Slots
-
default— Renders the tree items inside default slot.
Properties
Section titled "Properties"selection
Section titled "selection"The selection mode of the tree. A change clears the current selection.
selection: TreeSelection singleBranchExpand
Section titled "singleBranchExpand"Whether only one branch of the tree can be expanded at a time. When the user expands an item, the items outside its path collapse.
singleBranchExpand: boolean toggleNodeOnClick
Section titled "toggleNodeOnClick"Whether a click on an item toggles its expanded state.
toggleNodeOnClick: boolean Accessors
Section titled "Accessors"items
Section titled "items"All items of the tree, in document order. Empty during server-side rendering.
get items(): IgrTreeItemComponent[]
Returns IgrTreeItemComponent[]
Methods
Section titled "Methods"collapse
Section titled "collapse"Collapses all of the passed items. If no items are passed, collapses ALL items.
collapse(items: IgrTreeItemComponent[]): void Parameters
- items:
IgrTreeItemComponent[]
Returns void
connectedCallback
Section titled "connectedCallback"Invoked when the component is added to the document's DOM.
In connectedCallback() you should setup tasks that should only occur when
the element is connected to the document. The most common of these is
adding event listeners to nodes external to the element, like a keydown
event handler added to the window.
``
Typically, anything done in connectedCallback() should be undone when the
element is disconnected, in disconnectedCallback().
connectedCallback(): void Returns void
deselect
Section titled "deselect"Deselects the passed items. Without an argument, deselects all items. Emits no event.
deselect(items: IgrTreeItemComponent[]): void Parameters
- items:
IgrTreeItemComponent[]
Returns void
expand
Section titled "expand"Expands all of the passed items. If no items are passed, expands ALL items.
expand(items: IgrTreeItemComponent[]): void Parameters
- items:
IgrTreeItemComponent[]
Returns void
select
Section titled "select"Selects the passed items. Without an argument, selects all items. Emits no event.
select(items: IgrTreeItemComponent[]): void Parameters
- items:
IgrTreeItemComponent[]
Returns void
Events
Section titled "Events"onActiveItem
Section titled "onActiveItem"Emitted when the tree's
onActiveItem(args: CustomEvent<IgrTreeItemComponent>): void Parameters
- args:
CustomEvent<IgrTreeItemComponent>
Returns void
onItemCollapsed
Section titled "onItemCollapsed"Emitted when tree item is collapsed.
onItemCollapsed(args: CustomEvent<IgrTreeItemComponent>): void Parameters
- args:
CustomEvent<IgrTreeItemComponent>
Returns void
onItemCollapsing
Section titled "onItemCollapsing"Emitted when tree item is about to collapse. Cancelable.
onItemCollapsing(args: CustomEvent<IgrTreeItemComponent>): void Parameters
- args:
CustomEvent<IgrTreeItemComponent>
Returns void
onItemExpanded
Section titled "onItemExpanded"Emitted when tree item is expanded.
onItemExpanded(args: CustomEvent<IgrTreeItemComponent>): void Parameters
- args:
CustomEvent<IgrTreeItemComponent>
Returns void
onItemExpanding
Section titled "onItemExpanding"Emitted when tree item is about to expand. Cancelable.
onItemExpanding(args: CustomEvent<IgrTreeItemComponent>): void Parameters
- args:
CustomEvent<IgrTreeItemComponent>
Returns void
onSelection
Section titled "onSelection"Emitted when item selection is changing, before the selection completes. Cancelable.
onSelection(args: CustomEvent<IgrTreeSelectionEventArgs>): void