Class Tree

A tree that can be expanded and collapsed, and can also have children.

Hierarchy (view full)

Constructors

  • Create a new tree that can be expanded and collapsed. You can add children to the tree with the addChild method so that they appear in the tree.

    Parameters

    • Optional title: string = ''

      The title of the tree.

    • Optional expanded: boolean = false

      Whether the tree is expanded.

    Returns Tree

Properties

arrowRef: HTMLSpanElement
contentRef: HTMLDivElement
headerRef: HTMLDivElement
listeners: {
    [key: string]: Function[];
}

Type declaration

  • [key: string]: Function[]
ref: HTMLDivElement
titleRef: HTMLSpanElement
value: any
view: View

Methods

  • The getConfig function returns a JSON representation of all values in the tree.

    Returns object

  • The loadConfig function loads a JSON object into the tree.

    Parameters

    • config: object

    Returns Tree

  • Parameters

    • event: string
    • callback: Function

    Returns void

  • Add a click event listener to the widget.

    Parameters

    • f: Function

      The function to call when the widget is clicked.

    Returns this

  • Set the text of the widget.

    Parameters

    • value: string

      The value to set the text to.

    Returns this

  • Set the title of the tree.

    Parameters

    • html: string

    Returns this

  • Toggle the tree between collapsed and expanded.

    Returns this