type

TreeNode

@Js
abstract class TreeNode : Obj

TreeNode models a node in a Tree.

See also: docDomkit

fields

parent

Parent node of this node, or null if this node is a root.

methods

children

Get the children of this node.

hasChildren

Return true if this has or might have children.

isExpanded

Is this node expanded?

onElem

Callback to customize Elem for this node.

Slot Details

children

virtual TreeNode[] children()

Get the children of this node. If no children return an empty list. Default behavior is no children. This method must return the same instances when called.

hasChildren

virtual Bool hasChildren()

Return true if this has or might have children. This is an optimization to display an expansion control without actually loading all the children. The default returns !children.isEmpty.

isExpanded

Bool isExpanded()

Is this node expanded?

onElem

abstract Void onElem(Elem elem, TreeFlags flags)

Callback to customize Elem for this node.

parent

TreeNode? parent { internal set }

Parent node of this node, or null if this node is a root.