Tree

(esrith/amos/form/Tree)

Tree is simple control used to represent tree structure. Tree contains collection of TreeNode object to represent each node.

Description
new Tree(params?srcNodeRef?)

Create a new Tree widget.

Type Description
_styleAttr Object

when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value

nodes Array

Array of TreeNode Object which represent node in this tree.

value Array

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

Return type Description
__baseClassInherit(constructor) None

get className from superclass.

add(TreeNodeindex) None

add new node to tree at specific position.

append(TreeNode) None

append node to this tree.

expandAll() None

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

Constructors Detail
new Tree(params?srcNodeRef?)

Create a new Tree widget.

Parameters:
Properties Detail
<Object>
_styleAttr

when you want to set style for other node. you can do this by example... _styleAttr:{ style-property:effected-node } this property was effected where this class was inherited and your widget was called by... var widget = new YourWidget({ style:{ style-property:style-value } }); now effected-node in you widget will have style-property = style-value

Default value: {}

<Array>
nodes

Inherited from _TreeBase but overwritten in esrith/amos/form/Tree.js:89

Array of TreeNode Object which represent node in this tree.

<Array>
value

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

Methods Detail
__baseClassInherit
(
  • constructor
)

get className from superclass.

Parameters
  • <Object> constructor Required
add
(
  • TreeNode
  • index
)

Inherited from _TreeBase but overwritten in esrith/amos/form/Tree.js:95

add new node to tree at specific position.

Parameters
  • <TreeNode Object> TreeNode 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
(
  • TreeNode
)

Inherited from _TreeBase but overwritten in esrith/amos/form/Tree.js:102

append node to this tree.

Parameters
  • <TreeNode Object> TreeNode Required

    object you want to add to this tree.

expandAll
()

Inherited from _TreeBase but overwritten in esrith/amos/core/_TreeBase.js:132

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

Inherited from _TreeBase but overwritten in esrith/amos/form/Tree.js:113

The event fires when node in tree is collapse.

Event Payload:
  • <TreeNode Object> node

    -tree node which is collapsed.

expand (node)

Inherited from _TreeBase but overwritten in esrith/amos/form/Tree.js:108

The event fires when node in tree is expand.

Event Payload:
  • <TreeNode Object> node

    -tree node which is expanded.