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.

Gets/Sets the locale used for getting language, affecting resource strings.

locale: string

The resource strings for localization. Currently only aria-labels of the default expand/collapse icons are localized for the tree item.

resourceStrings: ITreeResourceStrings

The selection state of the tree.

selection: TreeSelection

Whether a single or multiple of a parent's child items can be expanded.

singleBranchExpand: boolean

Whether clicking over nodes will change their expanded state or not.

toggleNodeOnClick: boolean

Returns all of the tree's items.

get items(): IgrTreeItemComponent[]

Returns IgrTreeItemComponent[]

Collapses all of the passed items. If no items are passed, collapses ALL items.

collapse(items: IgrTreeItemComponent[]): void

Parameters

  • items: IgrTreeItemComponent[]

Returns void

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 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

Expands all of the passed items. If no items are passed, expands ALL items.

expand(items: IgrTreeItemComponent[]): void

Parameters

  • items: IgrTreeItemComponent[]

Returns void

expandToItem(item: IgrTreeItemComponent): void

Parameters

  • item: IgrTreeItemComponent

Returns void

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

Emitted when the tree's

onActiveItem(args: CustomEvent<IgrTreeItemComponent>): void

Parameters

Returns void

Emitted when tree item is collapsed.

onItemCollapsed(args: CustomEvent<IgrTreeItemComponent>): void

Parameters

Returns void

Emitted when tree item is about to collapse.

onItemCollapsing(args: CustomEvent<IgrTreeItemComponent>): void

Parameters

Returns void

Emitted when tree item is expanded.

onItemExpanded(args: CustomEvent<IgrTreeItemComponent>): void

Parameters

Returns void

Emitted when tree item is about to expand.

onItemExpanding(args: CustomEvent<IgrTreeItemComponent>): void

Parameters

Returns void

Emitted when item selection is changing, before the selection completes.

onSelection(args: CustomEvent<IgrTreeSelectionEventArgs>): void

Parameters

Returns void