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
Static property used to define the default attribute
configuration for the TreeView.
Static property provides a string to identify the class.
Properties inherited from Base:
Configuration Attributes
io
- Object
IO metadata for loading the children using ajax.
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
protected
void
_createFromHTMLMarkup
(
container
)
Create TreeNode from HTML markup.
- Parameters:
-
container
<Node>
protected
void
_delegateDOM
(
)
Delegate events.
protected
void
_onClickHitArea
(
event
)
Fires on click
the TreeNode hitarea.
- Parameters:
-
event
<EventFacade>
protected
void
_onClickNodeEl
(
event
)
Fires on click the TreeView (i.e. set the select/unselect state).
- Parameters:
-
event
<EventFacade>
protected
void
_onMouseEnterNodeEl
(
event
)
Fires on mouseeneter
the TreeNode.
- Parameters:
-
event
<EventFacade>
protected
void
_onMouseLeaveNodeEl
(
event
)
Fires on mouseleave
the TreeNode.
- Parameters:
-
event
<EventFacade>
protected
void
_renderElements
(
)
Render elements.
protected
void
bindUI
(
)
Bind the events on the TreeView UI. Lifecycle.
protected
void
renderUI
(
)
Create the DOM structure for the TreeView. Lifecycle.
protected
void
syncUI
(
)
Sync the TreeView UI. Lifecycle.
Methods inherited from Base:
Events
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
(
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
(
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
Events inherited from Base: