Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ITreeModel

Hierarchy

  • ITreeModel

Index

Properties

activeNodes

activeNodes: ITreeNode[]
returns

Current active nodes

expandedNodes

expandedNodes: ITreeNode[]
returns

Current expanded nodes

focusedNode

focusedNode: ITreeNode

Current focused node

isFocused

isFocused: boolean

Is the tree currently focused

options

options: ITreeOptions

Options that were passed to the tree component

roots

roots: ITreeNode[]

All root nodes

Methods

clearFilter

  • clearFilter(): any
  • Marks all nodes isHidden = false

    Returns any

collapseAll

  • collapseAll(): any
  • collapse all nodes

    Returns any

doForAll

  • doForAll(fn: function): any
  • Invokes a method for every node of the tree - depth first

    Parameters

    • fn: function

      a function that receives the node

    Returns any

expandAll

  • expandAll(): any
  • expand all nodes

    Returns any

filterNodes

  • filterNodes(filter: any, autoShow?: boolean): any
  • Marks isHidden field in all nodes recursively according to the filter param. If a node is marked visible, all of its ancestors will be marked visible as well.

    Parameters

    • filter: any

      either a string or a function. In case it's a string, it will be searched case insensitively in the node's display attribute In case it's a function, it will be passed the node, and should return true if the node should be visible, false otherwise

    • Optional autoShow: boolean

      if true, make sure all nodes that passed the filter are visible

    Returns any

focusDrillDown

  • focusDrillDown(): any
  • Focuses on the inner child of the current focused node (same as right arrow on an expanded node)

    Returns any

focusDrillUp

  • focusDrillUp(): any
  • Focuses on the parent of the current focused node (same as left arrow on a collapsed node)

    Returns any

focusNextNode

  • focusNextNode(): any
  • Focuses on the next node in the tree (same as down arrow)

    Returns any

focusPreviousNode

  • focusPreviousNode(): any
  • Focuses on the previous node in the tree (same as up arrow)

    Returns any

getActiveNode

  • Returns ITreeNode

    Current active node. If multiple nodes are active - returns the first one.

getFirstRoot

  • getFirstRoot(skipHidden?: boolean): ITreeNode
  • Parameters

    • Optional skipHidden: boolean

      true or false - whether to skip hidden nodes

    Returns ITreeNode

    first root of the tree

getFocusedNode

  • Returns ITreeNode

    Current focused node (either hovered or traversed with keys)

getLastRoot

  • getLastRoot(skipHidden?: boolean): ITreeNode
  • Parameters

    • Optional skipHidden: boolean

      true or false - whether to skip hidden nodes

    Returns ITreeNode

    last root of the tree

getNodeBy

  • Parameters

    • predicate: any

      either an object or a function, used as a test condition on all nodes. Could be every predicate that's supported by lodash's find method

    • Optional startNode: ITreeNode

    Returns ITreeNode

    First node that matches the predicate, if found - null otherwise

getNodeById

getNodeByPath

  • Parameters

    • path: any[]

      array of node IDs to be traversed respectively

    • Optional startNode: ITreeNode

    Returns ITreeNode

    The node, if found - null otherwise

getState

getVisibleRoots

isEmptyTree

  • isEmptyTree(): boolean
  • Returns boolean

    true if the tree is empty

moveNode

  • moveNode(node: ITreeNode, to: object, from: object): any
  • moves a node from one location in the tree to another

    Parameters

    • node: ITreeNode

      describes which node needs to be moved

    • to: object

      describes where to move the node to.

      • dropOnNode: boolean
      • index: number
      • parent: ITreeNode
    • from: object

      describes where to move the node from. Contains a 'parent' node, an 'index', and a 'dropOnNode' - to distinguish between dropping between nodes or on the node

    Returns any

setFocus

  • setFocus(value: boolean): any
  • Focuses or blurs the tree

    Parameters

    • value: boolean

      true or false - whether to set focus or blur.

    Returns any

setFocusedNode

setState

subscribeToState

  • subscribeToState(fn: function): any

Generated using TypeDoc