- Description:
 Implement an accessible aria tree widget, from a nested unordered list. Based on http://oaa-accessibility.org/example/41/
To respond to selection changed events - use tree.on("selectionchanged", handler). The handler will receive an array of nodes, which are the list items that are currently selected. (Or a single node if multiselect is disabled).
- Source:
 - Copyright:
 - 2015 Damyon Wiese 
 
- 2015 Damyon Wiese 
 - License:
 - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 
Implement an accessible aria tree widget, from a nested unordered list. Based on http://oaa-accessibility.org/example/41/
To respond to selection changed events - use tree.on("selectionchanged", handler). The handler will receive an array of nodes, which are the list items that are currently selected. (Or a single node if multiselect is disabled).
Members
(inner) collapsedImage :String
- Description:
 The html for a collapsed tree node twistie.
- Source:
 
The html for a collapsed tree node twistie.
Type:
- String
 
(inner) expandedImage :String
- Description:
 The html for an expanded tree node twistie.
- Source:
 
The html for an expanded tree node twistie.
Type:
- String
 
Methods
(inner) bindEventHandlers()
- Description:
 Bind the event listeners we require.
- Source:
 
(inner) collapseGroup(item)
- Description:
 Collapse an expanded group.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
(inner) expandGroup(item)
- Description:
 Expand a collapsed group.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
(inner) handleBlur() → {Boolean}
- Description:
 Handle a blur event
- Source:
 
Returns:
- Type
 - Boolean
 
(inner) handleClick(item, e) → {Boolean}
- Description:
 Handle a click (select).
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
e | 
            
            Event | The event.  | 
        
Returns:
- Type
 - Boolean
 
(inner) handleDblClick(item, e) → {Boolean}
- Description:
 Handle a double click (expand/collapse).
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
e | 
            
            Event | The event.  | 
        
Returns:
- Type
 - Boolean
 
(inner) handleExpandCollapseClick(item, e) → {Boolean}
- Description:
 Handle a click (select).
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
e | 
            
            Event | The event.  | 
        
Returns:
- Type
 - Boolean
 
(inner) handleFocus(item) → {Boolean}
- Description:
 Handle a focus event
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | item is the jquery id of the parent item of the group  | 
        
Returns:
- Type
 - Boolean
 
(inner) handleKeyDown(item, e) → {Boolean}
- Description:
 Handle a key down event - ie navigate the tree.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
e | 
            
            Event | The event.  | 
        
Returns:
- Type
 - Boolean
 
(inner) handleKeyPress(item, e) → {Boolean}
- Description:
 Handle a key press event - ie navigate the tree.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
e | 
            
            Event | The event.  | 
        
Returns:
- Type
 - Boolean
 
(inner) init()
- Description:
 Init this tree
- Source:
 
(inner) multiSelectItem(item)
- Description:
 Select all the items between the last focused item and this currently focused item.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the newly selected item.  | 
        
(inner) on(eventname, handler)
- Description:
 Attach an event listener to the tree.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
eventname | 
            
            String | This is the name of the event to listen for. Only 'selectionchanged' is supported for now.  | 
        
handler | 
            
            function | The function to call when the event is triggered.  | 
        
(inner) selectItem(item)
- Description:
 Select a single item. Make sure all the parents are expanded. De-select all other items.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the newly selected item.  | 
        
(inner) toggleGroup(item)
- Description:
 Expand or collapse a group.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  | 
        
(inner) toggleItem(item)
- Description:
 Toggle the selected state for an item back and forth.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the item to toggle.  | 
        
(inner) triggerChange()
- Description:
 Whenever the currently selected node has changed, trigger an event using this function.
- Source:
 
(inner) updateFocus(item)
- Description:
 Set the focus to this item.
- Source:
 
Parameters:
| Name | Type | Description | 
|---|---|---|
item | 
            
            Object | is the jquery id of the parent item of the group  |