Constructor
new TreeNode(config)
Create a new TreeNode with the given configuration
Parameters:
Name | Type | Description |
---|---|---|
config |
TreeNode~config | The configuration for this TreeNode |
Members
alwaysOpen
childNodes :Array.<TreeNode>
The children of this TreeNode
Type:
- Array.<TreeNode>
context
html :Element
The DOM Element of this TreeNode
Type:
- Element
metaIcons :Array.<Element>
Meta icons of this TreeNode
Type:
- Array.<Element>
parentNode :TreeNode
The parent node of this TreeNode
Type:
type
Methods
addMetaIcon(icon)
Add a meta icon to this TreeNode
Parameters:
Name | Type | Description |
---|---|---|
icon |
* |
addNode(index, node)
Add a child node to this node at a given index
Parameters:
Name | Type | Description |
---|---|---|
index |
Number | |
node |
TreeNode |
clearNodes()
Removes all child nodes from this TreeNode
fold()
Fold this TreeNode
getProperty(propertyName, defaultValueopt) → {*}
Retrieve the value of the given property
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
propertyName |
String | |||
defaultValue |
* |
<optional> |
null
|
The default value if the property does not exist |
Returns:
- Type
- *
getTreeBrowser() → {null|TreeBrowser}
Return the TreeBrowser at the top of the tree this TreeNode is in, if any
Returns:
- Type
- null | TreeBrowser
isFolded() → {boolean}
Check wether this TreeNode is folded or unfolded
Returns:
- True of this TreeNode is folded, false if unfolded
- Type
- boolean
isLeaf() → {boolean}
Checks if this TreeNode has any children
Returns:
True/False depending on if this TreeNode has any children
- Type
- boolean
onDecorated()
Called when this TreeNode has been decorated
onRemoved()
Called when we are removed from the tree
removeMetaIcon(icon)
Remove a meta icon from this TreeNode
Parameters:
Name | Type | Description |
---|---|---|
icon |
* |
removeNode(node)
Remove a child node from this node
Parameters:
Name | Type | Description |
---|---|---|
node |
TreeNode |
reveal()
Make this TreeNode and all parent TreeNode's unfold,
select()
Make this TreeNode the selected node in the tree
setProperty(propertyName, value)
Sets the value of the given property
Parameters:
Name | Type | Description |
---|---|---|
propertyName |
String | |
value |
* |
toggleFold()
Toggle fold state of this TreeNode
triggerAction()
Trigger the action listeners of this TreeNode
unfold()
Unfold this TreeNode
Type Definitions
config
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type |
string | The type of this TreeNode, ex. "DomTreeNode", "AssetNode", "AssetRootNode" | ||
context |
* | The context of this TreeNode | ||
alwaysOpen |
boolean |
<optional> |
false
|
If this TreeNode should stay unfolded |
lookupKey |
* |
<optional> |
context
|
The lookupkey to use when TreeGenerator saves this TreeNode for later lookup |
startOpen |
boolean |
<optional> |
false
|
If this TreeNode should start unfolded |
hideSelf |
boolean |
<optional> |
false
|
If this TreeNode should be hidden. |
Type:
- Object
Events
EventSystem:"TreeBrowser.TreeNode.Action"
Properties:
Name | Type | Description |
---|---|---|
node |
TreeNode | The node which had its action triggered |
Called when a TreeNode's action is triggered. (Ie. double click it)
Type:
- CustomEvent