TreeNode

(esrith/amos/form/TreeNode)

TreeNode is simple tree node and used in Tree.

Description
new TreeNode(params?srcNodeRef?)

Create a new TreeNode 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

alwaysShowChevron Boolean

if true, chevron will be always shown even if it has no child at all.

child Array

Array of TreeNode Object which represent child of this node.

expand Boolean

if true, node will expand to display the children.

state Unknown
title String

title of tree node.

Return type Description
__baseClassInherit(constructor) None

get className from superclass.

add(TreeNodeindex) None

add child to this node at specific position.

append(TreeNode) None

append child to this node.

appendDomNode(domNode) None

append domNode to this tree.

getParent() Object

get parent of this node. Return null if it has no parent.

remove(index) None

remove child from this node.

removeAll() None

remove all children from this node.

removeAllDetailsNodes() None

remove all details nodes from this node.

removeDetailsNode(domNode) None

remove details node from this node.

Description
child-state-change (childNode, oldState, state)

The event fires when child state of this tree node is changed.

collapse

The event fires when tree node is collapse.

expand

The event fires when tree node is expand.

state-change (oldState, state)

The event fires when tree node state is changed.

Constructors Detail
new TreeNode(params?srcNodeRef?)

Create a new TreeNode 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: {}

<Boolean>
alwaysShowChevron

if true, chevron will be always shown even if it has no child at all.

<Array>
child

Inherited from _TreeNodeBase but overwritten in esrith/amos/form/TreeNode.js:91

Array of TreeNode Object which represent child of this node.

<Boolean>
expand

if true, node will expand to display the children.

<Unknown>
state
deprecated

Inherited from _TreeNodeBase but overwritten in esrith/amos/form/TreeNode.js:85

<String>
title

title of tree node.

Methods Detail
__baseClassInherit
(
  • constructor
)

get className from superclass.

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

Inherited from _TreeNodeBase but overwritten in esrith/amos/form/TreeNode.js:97

add child to this node at specific position.

Parameters
  • <TreeNode Object> TreeNode Required

    object you want to add as a child of this node.

  • <Number> index Required

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

append
(
  • TreeNode
)

Inherited from _TreeNodeBase but overwritten in esrith/amos/form/TreeNode.js:104

append child to this node.

Parameters
  • <TreeNode Object> TreeNode Required

    object you want to add as a child of this node.

appendDomNode
(
  • domNode
)

append domNode to this tree.

Parameters
  • <DOMNode> domNode Required

    you want to add to this tree.

<Object>
getParent
()

get parent of this node. Return null if it has no parent.

remove
(
  • index
)

remove child from this node.

Parameters
  • <Number> index Required

    position of child you want to remove (index start at 0). index = 0 mean you want to remove first child.

removeAll
()

remove all children from this node.

removeAllDetailsNodes
()

remove all details nodes from this node.

removeDetailsNode
(
  • domNode
)

remove details node from this node.

Parameters
  • <DOMNode> domNode Required

    you want to remove to this tree.

Events Detail
child-state-change (childNode, oldState, state)

The event fires when child state of this tree node is changed.

Event Payload:
  • <Object> childNode

    -Tree Node object of child which state is changed.

  • <Object> oldState

    -Old state before changed.

  • <Object> state

    -new state.

collapse

The event fires when tree node is collapse.

expand

The event fires when tree node is expand.

state-change (oldState, state)

The event fires when tree node state is changed.

Event Payload:
  • <Object> oldState

    -Old state before changed.

  • <Object> state

    -new state.