class
SAPO.Ink.TreeView
Version:
0.1
Displays a tree structure. Uses unordered lists internally. Supports multi-root trees by keeping hidden a '' valued root upwards. Each node in the model is an array: - index 0 is its value (a String) - index 1 is an optional array of child nodes - index 2 is optional. if trueish collapses its children this structure is recursive. Every node can be referenced by index. An index is an array of integers, going down the free from its root.
Since:
Defined in
Ink/TreeView/0.1/lib.js
October 2012
Constructor Summary
Function Summary
collapses all non-leaf nodes
destroy()
unregisters the component and removes its markup from the DOM
expands all non-leaf nodes
returns the node value, given its index
toggleNode
(Number[]
index)
toggles the node given its index
Constructor Details
constructor TreeView
TreeView(String|DOMElement
selector, Object
options)
Parameters:
selector
options
-
[ Boolean selectable ]
-
[ Boolean startsCollapsed ]
-
[ Function onClick ]
Function Details
function collapseTree
collapseTree()
collapses all non-leaf nodes
function destroy
destroy()
unregisters the component and removes its markup from the DOM
function expandTree
expandTree()
expands all non-leaf nodes
function getModel
String[]
getModel()
returns a copy of the model
function getNodeValue
String
getNodeValue(Number[]
index)
returns the node value, given its index
Parameters:
index
function toggleNode
toggleNode(Number[]
index)
toggles the node given its index
Parameters:
index