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"locale
Section titled "locale"Gets/Sets the locale used for getting language, affecting resource strings.
locale: string resourceStrings
Section titled "resourceStrings"The resource strings for localization. Currently only aria-labels of the default expand/collapse icons are localized for the tree item.
resourceStrings: ITreeResourceStrings selection
Section titled "selection"The selection state of the tree.
selection: TreeSelection singleBranchExpand
Section titled "singleBranchExpand"Whether a single or multiple of a parent's child items can be expanded.
singleBranchExpand: boolean toggleNodeOnClick
Section titled "toggleNodeOnClick"Whether clicking over nodes will change their expanded state or not.
toggleNodeOnClick: boolean Accessors
Section titled "Accessors"items
Section titled "items"Returns all of the tree's items.
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"Deselect all items if the items collection is empty. Otherwise, deselect the items in the items collection.
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
expandToItem
Section titled "expandToItem"expandToItem(item: IgrTreeItemComponent): void Parameters
- item:
IgrTreeItemComponent
Returns void
select
Section titled "select"Select all items if the items collection is empty. Otherwise, select the items in the items collection.
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.
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.
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.
onSelection(args: CustomEvent<IgrTreeSelectionEventArgs>): void