_TreeBase

(esrith/amos/core/_TreeBase)

The basic function of a Tree control.

Type Description
nodes Array

Array of _TreeNodeBase Object which represent child of this node.

value Array

Array of value of all nodes and it's children. This property is read-only.

Return type Description
add(_TreeNodeBaseindex) None

add new node to tree at specific position.

append(_TreeNodeBase) None

append node to this tree.

expandAll() None

expand all nodes and children in the tree.

expandAll() None

collapse all nodes and children in the tree.

remove(index) None

remove node from this tree.

removeAll() None

remove all nodes from this tree.

Description
collapse (node)

The event fires when node in tree is collapse.

expand (node)

The event fires when node in tree is expand.

Properties Detail
<Array>
nodes

Array of _TreeNodeBase Object which represent child of this node.

<Array>
value

Array of value of all nodes and it's children. This property is read-only.

Methods Detail
add
(
  • _TreeNodeBase
  • index
)

add new node to tree at specific position.

Parameters
  • <_TreeNodeBase Object> _TreeNodeBase Required

    object you want to add to this tree.

  • <Number> index Required

    position you want to locate this node (index start at 0). index = 0 means it will be the first node of this tree.

append
(
  • _TreeNodeBase
)

append node to this tree.

Parameters
  • <_TreeNodeBase Object> _TreeNodeBase Required

    object you want to add to this tree.

expandAll
()

expand all nodes and children in the tree.

expandAll
()

collapse all nodes and children in the tree.

remove
(
  • index
)

remove node from this tree.

Parameters
  • <Index Number> index Required

    position of node you want to remove (index start at 0). index = 0 mean you want to remove first node in this tree.

removeAll
()

remove all nodes from this tree.

Events Detail
collapse (node)

The event fires when node in tree is collapse.

Event Payload:
  • <_TreeNodeBase Object> node

    -tree node which is collapsed.

expand (node)

The event fires when node in tree is expand.

Event Payload:
  • <_TreeNodeBase Object> node

    -tree node which is expanded.