Alloy UI

aui-tree  1.0.1

 
Filters

Class TreeNode - extends TreeData

Known Subclasses:
TreeNodeIO
A base class for TreeNode, providing:
  • Widget Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)
  • The node for the TreeView component
Quick Example:
var instance = new A.TreeNode({
boundingBox: ''
}).render();
Check the list of Configuration Attributes available for TreeNode.

Constructor

TreeNode ( config )
Parameters:
config <Object> Object literal specifying widget configuration properties.

Properties

A.TreeNode.nodeTypes - Object

TreeNode types hash map.
A.TreeNode.nodeTypes = {
task: A.TreeNodeTask,
check: A.TreeNodeCheck,
node: A.TreeNode,
io: A.TreeNodeIO
};

BOUNDING_TEMPLATE - protected String

Replaced BOUNDING_TEMPLATE with NODE_BOUNDING_TEMPLATE.

CONTENT_TEMPLATE - protected String

Replaced CONTENT_TEMPLATE with NODE_CONTENT_TEMPLATE.

TreeNode.ATTRS - static Object

Static property used to define the default attribute configuration for the TreeNode.

TreeNode.NAME - static String

Static property provides a string to identify the class.

Properties inherited from TreeData:

Properties inherited from Attribute:

Properties inherited from Base:

Configuration Attributes

alwaysShowHitArea - boolean

Always show the hitarea icon.
Default Value: true

draggable - boolean

If true the TreeNode is draggable.
Default Value: true

expanded - boolean

Whether the TreeNode is expanded by default.
Default Value: false

hitAreaEl - Node | String

Hitarea element.
Default Value: Generated DOM element.

iconEl - Node | String

Icon element.

id - String

Id of the TreeNode.
Default Value: null

label - String

Label of the TreeNode.
Default Value: ''

labelEl - Node | String

Label element to house the label attribute.
Default Value: Generated DOM element.

leaf - boolean

Whether the TreeNode could have children or not (i.e. if any children is present the TreeNode is a leaf).
Default Value: true

nextSibling - TreeNode

Next sibling of the current TreeNode.
Default Value: null

ownerTree - TreeView

TreeView which contains the current TreeNode.
Default Value: null

parentNode - TreeNode

Parent node of the current TreeNode.
Default Value: null

prevSibling - TreeNode

Previous sibling of the current TreeNode.
Default Value: null

Configuration attributes inherited from TreeData:

Configuration attributes inherited from Base:

Methods

_afterSetChildren

protected void _afterSetChildren ( event )
Fires after set children.
Parameters:
event <EventFacade>

_collapse

protected void _collapse ( )
Collapse the current TreeNode.

_createNodeContainer

protected Node _createNodeContainer ( )
Render the node container.

_expand

void _expand ( )
Expand the current TreeNode.

_renderBoundingBox

protected Node _renderBoundingBox ( )
Render the boundingBox node.

_renderContentBox

protected Node _renderContentBox ( )
Render the contentBox node.

_renderUI

protected void _renderUI ( )
Create the DOM structure for the TreeNode. Lifecycle. Overloading private _renderUI, don't call this._renderBox method avoid render node on the body.

_syncHitArea

protected void _syncHitArea ( children )
Sync the hitarea UI.
Parameters:
children <Array>

_syncTreeNodeBBId

protected void _syncTreeNodeBBId ( id )
Set the boundingBox id.
Parameters:
id <String>

bindUI

protected void bindUI ( )
Bind the events on the TreeNode UI. Lifecycle.

collapse

void collapse ( )
Collapse the current TreeNode.

contains

boolean contains ( node )
Check if the current TreeNode contains the passed node.
Parameters:
node <TreeNode>

expand

void expand ( )
Expand the current TreeNode.

getDepth

Number getDepth ( )
Get the depth of the current TreeNode.

initializer

protected void initializer ( )
Construction logic executed during TreeNode instantiation. Lifecycle.

isLeaf

boolean isLeaf ( )
Whether the current TreeNode is a leaf or not.

isSelected

boolean isSelected ( )
Whether the current TreeNode is selected or not.

renderUI

protected void renderUI ( )
Create the DOM structure for the TreeNode. Lifecycle.

syncUI

protected void syncUI ( )
Sync the TreeNode UI. Lifecycle.

toggle

void toggle ( )
Toggle the current TreeNode, collapsed or expanded.

Methods inherited from Plugin.Host:

Events

alwaysShowHitAreaChange

alwaysShowHitAreaChange ( event )
Fires when the value for the configuration attribute 'alwaysShowHitArea' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

draggableChange

draggableChange ( event )
Fires when the value for the configuration attribute 'draggable' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

expandedChange

expandedChange ( event )
Fires when the value for the configuration attribute 'expanded' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

hitAreaElChange

hitAreaElChange ( event )
Fires when the value for the configuration attribute 'hitAreaEl' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

iconElChange

iconElChange ( event )
Fires when the value for the configuration attribute 'iconEl' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

idChange

idChange ( event )
Fires when the value for the configuration attribute 'id' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

labelChange

labelChange ( event )
Fires when the value for the configuration attribute 'label' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

labelElChange

labelElChange ( event )
Fires when the value for the configuration attribute 'labelEl' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

leafChange

leafChange ( event )
Fires when the value for the configuration attribute 'leaf' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

nextSiblingChange

nextSiblingChange ( event )
Fires when the value for the configuration attribute 'nextSibling' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

ownerTreeChange

ownerTreeChange ( event )
Fires when the value for the configuration attribute 'ownerTree' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

parentNodeChange

parentNodeChange ( event )
Fires when the value for the configuration attribute 'parentNode' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set

prevSiblingChange

prevSiblingChange ( event )
Fires when the value for the configuration attribute 'prevSibling' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.
Parameters:
event<Event.Facade> An Event Facade object with the following attribute specific properties added:
prevVal
The value of the attribute, prior to it being set
newVal
The value the attribute is to be set to
attrName
The name of the attribute being set
subAttrName
If setting a property within the attribute's value, the name of the sub-attribute property being set