A2v10 Platform documentation
UK


Properties and Methods of the Tree Item

Each tree item is expanded with the following additional service properties and methods:


Properties

readonly $expanded: boolean

Item is expanded.

Methods

			
		

Description

Expands the tree item (if it was collapsed). Works for both static and dynamic trees.

Returns:

  • A promise with a reference to an array of expanded children.

Methods

			
		

Arguments:

  • path - an array that defines the path in the tree, starting at the root. The array can contain any items.
  • predicate - a function that will be called to search for a specified item in the tree. Should return true, if the item in the tree matches an item in the val array. Predicate arguments:
    • item: ITreeElement - item of the tree.
    • val: any - item from the array path.

Description

Selects an item in the tree along the specified path. Only useful for dynamic trees. In the process, the method expands all intermediate nodes.

Returns:

  • A promise with a reference to the selected tree item.

Working with trees is described in more detail in the section on hierarchical data models.