Version 3.17.2
Show:

Tree.Openable Class

Module: tree-openable
Parent Module: tree

Extension for Tree that adds the concept of open/closed state for nodes.

Constructor

Tree.Openable

()

Methods

_defCloseFn

(
  • e
)
protected

Default handler for the close event.

Parameters:

_defOpenFn

(
  • e
)
protected

Default handler for the open event.

Parameters:

closeNode

(
  • node
  • [options]
)
chainable

Closes the specified node if it isn't already closed.

Parameters:

  • node Tree.Node

    Node to close.

  • [options] Object optional

    Options.

    • [silent=false] Boolean optional

      If true, the close 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.

openNode

(
  • node
  • [options]
)
chainable

Opens the specified node if it isn't already open.

Parameters:

  • node Tree.Node

    Node to open.

  • [options] Object optional

    Options.

    • [silent=false] Boolean optional

      If true, the open 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.

toggleOpenNode

(
  • node
  • [options]
)
chainable

Toggles the open/closed state of the specified node, closing it if it's currently open or opening it if it's currently closed.

Parameters:

  • node Tree.Node

    Node to toggle.

  • [options] Object optional

    Options.

    • [silent=false] Boolean optional

      If true, events 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.

Events

close

Fired when a node is closed.

Event Payload:

open

Fired when a node is opened.

Event Payload: