Show:

Extension for Tree that adds the concept of selection state for nodes.

Constructor

Methods

getSelectedNodes

() Tree.Node.Selectable[]

Returns an array of nodes that are currently selected.

Returns:

Tree.Node.Selectable[]:

Array of selected nodes.

selectNode

(
  • node
  • [options]
)
chainable

Selects the specified node.

Parameters:

  • node Tree.Node.Selectable

    Node to select.

  • [options] Object optional

    Options.

    • [silent=false] Boolean optional

      If true, the select event will be suppressed.

    • [src] String optional

      Source of the change, to be passed along to the event facade of the resulting event. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example.

unselect

(
  • [options]
)
chainable

Unselects all selected nodes.

Parameters:

  • [options] Object optional

    Options.

    • [silent=false] Boolean optional

      If true, the unselect event will be suppressed.

    • [src] String optional

      Source of the change, to be passed along to the event facade of the resulting event. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example.

unselectNode

(
  • node
  • [options]
)
chainable

Unselects the specified node.

Parameters:

  • node Tree.Node.Selectable

    Node to unselect.

  • [options] Object optional

    Options.

    • [silent=false] Boolean optional

      If true, the unselect event will be suppressed.

    • [src] String optional

      Source of the change, to be passed along to the event facade of the resulting event. This can be used to distinguish between changes triggered by a user and changes triggered programmatically, for example.

Properties

_selectedMap

Object protected

Mapping of node ids to node instances for nodes in this tree that are currently selected.

Attributes

multiSelect

Boolean

Whether or not to allow multiple nodes to be selected at once.

Default: false

Events

select

Fired when a node is selected.

Event Payload:

unselect

Fired when a node is unselected.

Event Payload: