Version 3.18.1
Show:

Tree.Selectable Class

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

Constructor

Tree.Selectable

()

Item Index

Properties

Attributes

Events

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

Fires event multiSelectChange

Fires when the value for the configuration attribute multiSelect 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:

  • e EventFacade
    An Event Facade object with the following attribute-specific properties added:
    • prevVal Any
      The value of the attribute, prior to it being set.
    • newVal Any
      The value the attribute is to be set to.
    • attrName String
      The name of the attribute being set.
    • subAttrName String
      If setting a property within the attribute's value, the name of the sub-attribute property being set.

Events

select

Fired when a node is selected.

Event Payload:

unselect

Fired when a node is unselected.

Event Payload: