Class: IWTreeNode

IWTreeNode

This class provides a treeview node.

This class is part of the module controls.


new IWTreeNode(node)

Creates a new treeview node.
Parameters:
Name Type Description
node IWNodeElement the node model
Since:
  • 0.70

Methods


addChild(treeNode)

Adds a child node.
Parameters:
Name Type Description
treeNode IWTreeNode
Returns:
Type
void

getCheckbox()

Returns the checkbox for this treenode.
Returns:
checkbox
Type
HTMLInputElement

getChildren()

Returns the children as an array of treenodes.
Returns:
Type
Array.<IWTreeNode>

getContainer()

Returns the div container of this treeview node.
Returns:
the div container
Type
HTMLDivElement

getDomNode(newTreeImage)

Sets the tree image of this node.
Parameters:
Name Type Description
newTreeImage HTMLImage the image object for this tree node.
Returns:
Type
void

getNode()

Returns the corresponding node model.
Returns:
Type
IWNodeElement

getState()

Returns the state of the treeview node. The return value is null if the state has not been set. Otherwise it returns expanded or collapsed.
Returns:
Type
String

getTreeImage()

Returns the tree image of this node.
Returns:
treeImage
Type
HTMLImage

hasChildren()

Returns true if this node has children.
Returns:
Type
boolean

hasParent()

Returns true if this node has a parent node.
Returns:
Type
boolean

isCollapsed()

Returns true if the node is collapsed.
Returns:
Type
boolean

isExpanded()

Returns true if the node is expanded.
Returns:
Type
boolean

isLastChild()

Returns true if the node is the last child node of its parent.
Returns:
Type
boolean

setCheckbox(newCheckbox)

Sets the checkbox for this treenode.
Parameters:
Name Type Description
newCheckbox HTMLInputElement the checkbox element for this tree node.
Returns:
Type
void

setContainer(newContainer)

Sets the div container of this treeview node.
Parameters:
Name Type Description
newContainer HTMLDivElement the DIV element
Returns:
Type
void

setLastChild(isLastChild)

Set this attribute to true if the node is the last child of its parent.
Parameters:
Name Type Description
isLastChild boolean
Returns:
Type
void

setParent(parent)

Sets the parent node for this node.
Parameters:
Name Type Description
parent IWTreeNode
Returns:
Type
void

setState(newState)

Sets the state of the treeview node. Possible values are expanded and collapsed.
Parameters:
Name Type Description
newState String
Returns:
Type
void

toString()

Returns a string representation of this treenode.
Returns:
Type
String