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.
locale: string
resourceStrings: TGet

The selection mode of the tree. A change clears the current selection.

selection: TreeSelection

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

Whether a click on an item toggles its expanded state.

toggleNodeOnClick: boolean

All items of the tree, in document order. Empty during server-side rendering.

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

Deselects the passed items. Without an argument, deselects all items. Emits no event.

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

Selects the passed items. Without an argument, selects all items. Emits no event.

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

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

onItemExpanding(args: CustomEvent<IgrTreeItemComponent>): void

Parameters

Returns void

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

onSelection(args: CustomEvent<IgrTreeSelectionEventArgs>): void

Parameters

Returns void