Array of child nodes. For lazy nodes, null or undefined means 'not yet loaded'. Use an empty array to define a node that has no children.
Contains all extra data that was passed on node creation
Use isExpanded(), setExpanded() to access this property.
Addtional CSS classes, added to the node's <span>
.
Folder nodes have different default icons and click behavior. Note: Also non-folders may have children.
Icon of the tree node.
Node id (must be unique inside the tree)
True if this node is loaded on demand, i.e. on first expansion.
The parent node
Outer element of single nodes
null or type of temporarily generated system node like 'loading', or 'error'.
Display name (may contain HTML)
Alternative description used as hover banner
Outer element of single nodes for table extension
The tree instance
Optional
unselectableOptional
unselectableOptional
unselectableAppend (or insert) a list of child nodes.
array of child node definitions (also single child accepted)
Optional
insertBefore: FancytreeNodechild node to insert nodes before. If omitted, the new children is appended.
The first child added.
Append (or insert) a list of child nodes.
array of child node definitions (also single child accepted)
Optional
insertBefore: stringkey of the child node to insert nodes before. If omitted, the new children is appended.
The first child added.
Append (or insert) a list of child nodes.
array of child node definitions (also single child accepted)
Optional
insertBefore: numberindex of the child node to insert nodes before. If omitted, the new children is appended.
The first child added.
Append (or insert) a single child node.
node to add
Optional
insertBefore: FancytreeNodechild node to insert this node before. If omitted, the new child is appended.
The child added.
Append (or insert) a single child node.
node to add
Optional
insertBefore: stringkey of the child node to insert this node before. If omitted, the new child is appended.
The child added.
Append (or insert) a single child node.
node to add
Optional
insertBefore: numberindex of the child node to insert this node before. If omitted, the new child is appended.
The child added.
Add class to node's span tag and to .extraClasses.
class name
Append or prepend a node, or append a child node. This a convenience function that calls addChildren()
Optional
mode: string'before', 'after', 'firstChild', or 'child' ('over' is a synonym for 'child') (default='child')
new node.
Collapse all sibling nodes.
Copy this node as sibling or child of node
.
source node
Optional
mode: string'before' | 'after' | 'child' (default='child')
Optional
map: (node: NodeData) => voidcallback function(NodeData) that could modify the new node
new node.
Count direct and indirect children.
Optional
deep: booleanpass 'false' to only count direct children. (default=true)
Write to browser console if debugLevel >= 2 (prepending node info)
[ext-edit] Create a new child or sibling node and start edit mode.
Optional
mode: string'before', 'after', or 'child' (default='child')
Optional
init: ObjectNodeData (or simple title string)
[ext-edit] Stop inline editing.
false: cancel edit, true: save (if modified)
[ext-edit] Start inline editing of current node title.
Find all nodes that contain match
in the title.
string to search for
Find all nodes that contain match
in the title.
a function that returns true
if a node is matched.
Find first node that contains match
in the title (not including self).
string to search for
Find first node that contains match
in the title (not including self).
a function that returns true
if a node is matched.
Fix selection status, after this node was (de)selected in multi-hier mode. This includes (de)selecting all children.
Fix selection status for multi-hier mode. Only end-nodes are considered to update the descendants branch and parents. Should be called after this node has loaded new children or after children have been modified using the API.
Update node data. If dict contains 'children', then also replace the hole sub tree.
Return the list of child nodes (undefined for unexpanded lazy nodes).
[ext-clones] Return a list of clone-nodes or null.
Optional
includeSelf: booleanReturn the first child node or null.
Return the 0-based child index.
Return the hierarchical child index (1-based, e.g. '3.2.4').
Return the parent keys separated by options.keyPathSeparator, e.g. "id_1/id_17/id_32".
Return the last child of this node or null.
Return node depth. 0: System root node, 1: visible top-level node, 2: first sub-level, ... .
Return the successor node (under the same parent) or null.
Return the parent node (null for the system root node).
Return an array of all parent nodes (top-down).
Include the invisible system root node. (default=false)
Include the node itself (default=false).
Return the predecessor node (under the same parent) or null.
Return true if node has children. Return undefined if not sure, i.e. the node is lazy and not yet loaded).
Return true if node has keyboard focus.
Write to browser console if debugLevel >= 1 (prepending node info)
Return true if node is active (see also FancytreeNode.isSelected).
Return true if node is a direct child of otherNode.
[ext-clones] Return true if this node has at least another clone with same refKey.
Return true, if node is a direct or indirect sub node of otherNode.
[ext-edit] Check if this node is in edit mode.
Return true if node is expanded.
Return true if node is the first node of its parent's children.
Return true if node is a folder, i.e. has the node.folder attribute set.
Return true if node is the last node of its parent's children.
Return true if node is lazy (even if data was already loaded)
Return true if node is lazy and loaded. For non-lazy nodes always return true.
Return true if children are currently beeing loaded, i.e. a Ajax request is pending.
Return true if this is the (invisible) system root node.
Return true if node is selected, i.e. has a checkmark set (see also FancytreeNode#isActive).
Return true if this node is a temporarily generated system node like 'loading', or 'error' (node.statusNodeType contains the type).
Return true if this a top level node, i.e. a direct child of the (invisible) system root node.
Return true if node is lazy and not yet loaded. For non-lazy nodes always return false.
Return true if all parent nodes are expanded. Note: this does not check whether the node is scrolled into the visible part of the screen.
Load all children of a lazy node if neccessary. The expanded state is maintained.
Optional
forceReload: booleanPass true to discard any existing nodes before.
Expand all parents and optionally scroll into visible area as neccessary. Promise is resolved, when lazy loading and animations are done.
Optional
opts: Objectpassed to setExpanded()
. Defaults to {noAnimation: false, noEvents: false, scrollIntoView: true}
Move this node to targetNode.
'child': append this node as last child of targetNode. This is the default. To be compatble with the D'n'd hitMode, we also accept 'over'. 'before': add this node as sibling before targetNode. 'after': add this node as sibling after targetNode.
Optional
map: (node: FancytreeNode) => voidoptional callback(FancytreeNode) to allow modifcations
Set focus relative to this node and optionally activate.
The keyCode that would normally trigger this move, e.g. $.ui.keyCode.LEFT
would collapse the node if it is expanded or move to the parent oterwise.
Optional
activate: boolean(default=true)
Remove this node (not allowed for system root).
Remove all child nodes and descendents. This converts the node into a leaf. If this was a lazy node, it is still considered 'loaded'; call node.resetLazy() in order to trigger lazyLoad on next expand.
Remove class from node's span tag and .extraClasses.
class name
This method renders and updates all HTML markup that is required to display this node in its current state.
Optional
force: booleanre-render, even if html markup was already created
Optional
deep: booleanalso render all descendants, even if parent is collapsed
Update element's CSS classes according to node state.
Create HTML markup for the node's outer (expander, checkbox, icon, and title).
[ext-clones] Update key and/or refKey for an existing node.
Remove all children, collapse, and set the lazy-flag, so that the lazyLoad event is triggered on next expand.
Schedule activity for delayed execution (cancel any pending request). scheduleAction('cancel') will only cancel a pending request (if any).
Optional
effects: booleananimation options.
Optional
options: Object{topNode: null, effects: ..., parent: ...} this node will remain visible in any case, even if this
is outside the scroll pane.
Optional
flag: booleanpass false to deactivate
Optional
opts: Objectadditional options. Defaults to {noEvents: false}
Optional
flag: booleanpass false to collapse.
Optional
opts: Objectadditional options. Defaults to {noAnimation:false, noEvents:false}
Set keyboard focus to this node.
Optional
flag: booleanpass false to blur.
Select this node, i.e. check the checkbox.
Optional
flag: booleanpass false to deselect.
Mark a lazy node as 'error', 'loading', or 'ok'.
'error', 'ok'
Optional
message: stringOptional
details: stringRename this node.
Sort child list by title.
Optional
cmp: (a: FancytreeNode, b: FancytreeNode) => numbercustom compare function(a, b) that returns -1, 0, or 1 (defaults to sort by title).
Optional
deep: booleanpass true to sort all descendant nodes
Set, clear, or toggle class of node's span tag and .extraClasses.
class name (separate multiple classes by space)
Optional
flag: booleantrue/false to add/remove class. If omitted, class is toggled.
true if a class was added
Flip expanded status.
Flip selection status.
Call fn(node) for all child nodes. Stop iteration, if fn() returns false. Skip current branch, if fn() returns "skip". Return false if iteration was stopped.
the callback function. Return false to stop iteration, return "skip" to skip this node and its children only.
Optional
includeSelf: boolean(default=false)
Call fn(node) for all child nodes and recursively load lazy children. Note: If you need this method, you probably should consider to review your architecture! Recursivley loading nodes is a perfect way for lazy programmers to flood the server with requests ;-)
the callback function. Return false to stop iteration, return "skip" to skip this node and its children only.
Optional
includeSelf: boolean(default=false)
Call fn(node) for all parent nodes, bottom-up, including invisible system root. Stop iteration, if fn() returns false. Return false if iteration was stopped.
the callback function. Return false to stop iteration, return "skip" to skip this node and its children only.
Optional
includeSelf: boolean(default=false)
Write warning to browser console (prepending node info)
A FancytreeNode represents the hierarchical data model and operations.