Alloy UI

aui-tree  1.0.1

 
Filters

Class TreeView - extends TreeData

Known Subclasses:
TreeViewDD

A base class for TreeView, providing:
  • Widget Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)
Quick Example:
var tree2 = new A.TreeView({
width: 200,
type: 'normal',
boundingBox: '#tree',
children: [
{ label: 'Folder 1', children: [ { label: 'file' }, { label: 'file' }, { label: 'file' } ] },
{ label: 'Folder 2', expanded: true, children: [ { label: 'file' }, { label: 'file' } ] },
{ label: 'Folder 3', children: [ { label: 'file' } ] },
{ label: 'Folder 4', expanded: true, children: [ { label: 'Folder 4-1', expanded: true, children: [ { label: 'file' } ] } ] }
]
})
.render();
Check the list of Configuration Attributes available for TreeView.

Constructor

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

Properties

TreeView.ATTRS - static Object

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

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

io - Object

IO metadata for loading the children using ajax.
Default Value: null

lastSelected - TreeNode

Last selected TreeNode.
Default Value: null

type - String

Type of the treeview (i.e. could be 'file' or 'normal').
Default Value: 'file'

Configuration attributes inherited from TreeData:

Configuration attributes inherited from Base:

Methods

_createFromHTMLMarkup

protected void _createFromHTMLMarkup ( container )
Create TreeNode from HTML markup.
Parameters:
container <Node>

_delegateDOM

protected void _delegateDOM ( )
Delegate events.

_onClickHitArea

protected void _onClickHitArea ( event )
Fires on click the TreeNode hitarea.
Parameters:
event <EventFacade>

_onClickNodeEl

protected void _onClickNodeEl ( event )
Fires on click the TreeView (i.e. set the select/unselect state).
Parameters:
event <EventFacade>

_onMouseEnterNodeEl

protected void _onMouseEnterNodeEl ( event )
Fires on mouseeneter the TreeNode.
Parameters:
event <EventFacade>

_onMouseLeaveNodeEl

protected void _onMouseLeaveNodeEl ( event )
Fires on mouseleave the TreeNode.
Parameters:
event <EventFacade>

_renderElements

protected void _renderElements ( )
Render elements.

bindUI

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

renderUI

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

syncUI

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

Methods inherited from Plugin.Host:

Events

ioChange

ioChange ( event )
Fires when the value for the configuration attribute 'io' 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

lastSelectedChange

lastSelectedChange ( event )
Fires when the value for the configuration attribute 'lastSelected' 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

typeChange

typeChange ( event )
Fires when the value for the configuration attribute 'type' 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