tool_lp/tree

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:
License:
  • http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Members

(inner) collapsedImage :String

Source:

The html for a collapsed tree node twistie.

Type:
  • String

(inner) expandedImage :String

Source:

The html for an expanded tree node twistie.

Type:
  • String

Methods

(inner) bindEventHandlers()

Source:

Bind the event listeners we require.

(inner) collapseGroup(item)

Source:

Collapse an expanded group.

Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group

(inner) expandGroup(item)

Source:

Expand a collapsed group.

Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group

(inner) handleBlur() → {Boolean}

Source:

Handle a blur event

Returns:
Type
Boolean

(inner) handleClick(item, e) → {Boolean}

Source:

Handle a click (select).

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}

Source:

Handle a double click (expand/collapse).

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}

Source:

Handle a click (select).

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}

Source:

Handle a focus event

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}

Source:

Handle a key down event - ie navigate the tree.

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}

Source:

Handle a key press event - ie navigate the tree.

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()

Source:

Init this tree

(inner) multiSelectItem(item)

Source:

Select all the items between the last focused item and this currently focused item.

Parameters:
Name Type Description
item Object

is the jquery id of the newly selected item.

(inner) on(eventname, handler)

Source:

Attach an event listener to the tree.

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)

Source:

Select a single item. Make sure all the parents are expanded. De-select all other items.

Parameters:
Name Type Description
item Object

is the jquery id of the newly selected item.

(inner) toggleGroup(item)

Source:

Expand or collapse a group.

Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group

(inner) toggleItem(item)

Source:

Toggle the selected state for an item back and forth.

Parameters:
Name Type Description
item Object

is the jquery id of the item to toggle.

(inner) triggerChange()

Source:

Whenever the currently selected node has changed, trigger an event using this function.

(inner) updateFocus(item)

Source:

Set the focus to this item.

Parameters:
Name Type Description
item Object

is the jquery id of the parent item of the group