docs/Script API/interfaces/Frontend_Script_API._internal_.Fancytree.html
interface Fancytree {
$container: JQuery;
$div: JQuery;
focusNode: FancytreeNode;
options: FancytreeOptions;
rootNode: FancytreeNode;
widget: any;
activateKey(key: string | boolean): FancytreeNode;
applyPatch(patchList: NodePatch[]): JQueryPromise<any>;
changeRefKey(oldRefKey: string, newRefKey: string): void;
clearCookies(): void;
clearFilter(): void;
count(): number;
debug(msg: any): void;
enableUpdate(enabled: boolean): void;
expandAll(flag?: boolean, options?: Object): void;
filterBranches(filter: string): number;
filterBranches(filter: (node: FancytreeNode) => boolean): number;
filterNodes(filter: string, leavesOnly?: boolean): number;
filterNodes(
filter: (node: FancytreeNode) => boolean,
leavesOnly?: boolean,
): number;
findAll(
match: string | ((node: FancytreeNode) => undefined | boolean),
): FancytreeNode[];
findNextNode(match: string, startNode?: FancytreeNode): FancytreeNode;
findNextNode(
match: (node: FancytreeNode) => boolean,
startNode?: FancytreeNode,
): FancytreeNode;
generateFormElements(selected?: boolean, active?: boolean): void;
getActiveNode(): FancytreeNode;
getFirstChild(): FancytreeNode;
getFocusNode(ifTreeHasFocus?: boolean): FancytreeNode;
getNodeByKey(key: string, searchRoot?: FancytreeNode): FancytreeNode;
getNodesByRef(refKey: string, rootNode?: FancytreeNode): FancytreeNode[];
getPersistData(): PersistData;
getRootNode(): FancytreeNode;
getSelectedNodes(stopOnParents?: boolean): FancytreeNode[];
hasFocus(): boolean;
info(msg: any): void;
isEditing(): FancytreeNode;
loadKeyPath(
keyPathList: string[],
callback: (node: FancytreeNode, status: string) => void,
): JQueryPromise<any>;
loadKeyPath(
keyPath: string,
callback: (node: FancytreeNode, status: string) => void,
): JQueryPromise<any>;
reactivate(): void;
reload(source?: any): JQueryPromise<any>;
render(force?: boolean, deep?: boolean): void;
setFocus(flag?: boolean): void;
toDict(
includeRoot?: boolean,
callback?: (node: FancytreeNode) => void,
): any;
visit(fn: (node: FancytreeNode) => any): boolean;
warn(msg: any): void;
}
$container$divfocusNodeoptionsrootNodewidget
activateKeyapplyPatchchangeRefKeyclearCookiesclearFiltercountdebugenableUpdateexpandAllfilterBranchesfilterNodesfindAllfindNextNodegenerateFormElementsgetActiveNodegetFirstChildgetFocusNodegetNodeByKeygetNodesByRefgetPersistDatagetRootNodegetSelectedNodeshasFocusinfoisEditingloadKeyPathreactivatereloadrendersetFocustoDictvisitwarn
$container: JQuery
$div: JQuery
focusNode: FancytreeNode
options: FancytreeOptions
rootNode: FancytreeNode
widget: any
activateKey(key: string | boolean): FancytreeNode
Activate node with a given key and fire focus and activate events. A previously activated node will be deactivated. If activeVisible option is set, all parents will be expanded as necessary. Pass key = false, to deactivate the current node only.
activate node (null, if not found)
applyPatch(patchList: NodePatch[]): JQueryPromise<any>
(experimental)
resolved, when all patches have been applied
changeRefKey(oldRefKey: string, newRefKey: string): void
[ext-clones] Replace a refKey with a new one.
clearCookies(): void
[ext-persist] Remove persistence cookies of the given type(s). Called like $("#tree").fancytree("getTree").clearCookies("active expanded focus selected");
clearFilter(): void
[ext-filter] Reset the filter.
count(): number
Return the number of nodes.
debug(msg: any): void
Write to browser console if debugLevel >= 2 (prepending tree name)
enableUpdate(enabled: boolean): void
Temporarily suppress rendering to improve performance on bulk-updates.
previous status
2.19
expandAll(flag?: boolean, options?: Object): void
Expand (or collapse) all parent nodes.
Optionalflag: booleanOptionaloptions: ObjectfilterBranches(filter: string): number
[ext-filter] Dimm or hide whole branches.
count
filterBranches(filter: (node: FancytreeNode) => boolean): number
[ext-filter] Dimm or hide whole branches.
count
filterNodes(filter: string, leavesOnly?: boolean): number
[ext-filter] Dimm or hide nodes.
OptionalleavesOnly: booleancount
filterNodes(
filter: (node: FancytreeNode) => boolean,
leavesOnly?: boolean,
): number
[ext-filter] Dimm or hide nodes.
OptionalleavesOnly: booleancount
findAll(
match: string | ((node: FancytreeNode) => undefined | boolean),
): FancytreeNode[]
Find all nodes that matches condition.
array of nodes (may be empty)
findNextNode(match: string, startNode?: FancytreeNode): FancytreeNode
Find the next visible node that starts with match, starting at startNode and wrap-around at the end.
OptionalstartNode: FancytreeNodematching node or null
findNextNode(
match: (node: FancytreeNode) => boolean,
startNode?: FancytreeNode,
): FancytreeNode
Find the next visible node that starts with match, starting at startNode and wrap-around at the end.
OptionalstartNode: FancytreeNodematching node or null
generateFormElements(selected?: boolean, active?: boolean): void
Generate INPUT elements that can be submitted with html forms. In selectMode 3 only the topmost selected nodes are considered.
Optionalselected: booleanOptionalactive: booleangetActiveNode(): FancytreeNode
Return the currently active node or null.
getFirstChild(): FancytreeNode
Return the first top level node if any (not the invisible root node).
getFocusNode(ifTreeHasFocus?: boolean): FancytreeNode
Return node that has keyboard focus.
OptionalifTreeHasFocus: boolean(default: false) (not yet implemented)
getNodeByKey(key: string, searchRoot?: FancytreeNode): FancytreeNode
Return node with a given key or null if not found.
OptionalsearchRoot: FancytreeNode(optional) only search below this node.
getNodesByRef(refKey: string, rootNode?: FancytreeNode): FancytreeNode[]
[ext-clones] Return all nodes with a given refKey (null if not found).
OptionalrootNode: FancytreeNodeoptionally restrict results to descendants of this node.
getPersistData(): PersistData
[ext-persist] Return persistence information from cookies Called like $("#tree").fancytree("getTree").getPersistData();
getRootNode(): FancytreeNode
Return the invisible system root node.
getSelectedNodes(stopOnParents?: boolean): FancytreeNode[]
Return an array of selected nodes.
OptionalstopOnParents: booleanonly return the topmost selected node (useful with selectMode 3)
hasFocus(): boolean
Return true if the tree control has keyboard focus
info(msg: any): void
Write to browser console if debugLevel >= 1 (prepending tree name)
isEditing(): FancytreeNode
[ext-edit] Check if any node in this tree in edit mode.
loadKeyPath(
keyPathList: string[],
callback: (node: FancytreeNode, status: string) => void,
): JQueryPromise<any>
Make sure that a node with a given ID is loaded, by traversing - and loading - its parents. This method is ment for lazy hierarchies. A callback is executed for every node as we go.
one or more key paths (e.g. '/3/2_1/7')
callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error')
loadKeyPath(
keyPath: string,
callback: (node: FancytreeNode, status: string) => void,
): JQueryPromise<any>
Make sure that a node with a given ID is loaded, by traversing - and loading - its parents. This method is ment for lazy hierarchies. A callback is executed for every node as we go.
a key path (e.g. '/3/2_1/7')
callback(node, status) is called for every visited node ('loading', 'loaded', 'ok', 'error')
reactivate(): void
Re-fire beforeActivate and activate events.
reload(source?: any): JQueryPromise<any>
Reload tree from source and return a promise.
Optionalsource: anyoptional new source (defaults to initial source data)
render(force?: boolean, deep?: boolean): void
Render tree (i.e. create DOM elements for all top-level nodes).
Optionalforce: booleancreate DOM elements, even is parent is collapsed (default = false)
Optionaldeep: boolean(default = false)
setFocus(flag?: boolean): void
Optionalflag: boolean(default = true)
toDict(includeRoot?: boolean, callback?: (node: FancytreeNode) => void): any
Return all nodes as nested list of NodeData.
OptionalincludeRoot: booleanReturns the hidden system root node (and its children) (default = false)
Optionalcallback: (node: FancytreeNode) => voidCalled for every node
visit(fn: (node: FancytreeNode) => any): boolean
Call fn(node) for all nodes.
the callback function. Return false to stop iteration, return "skip" to skip this node and children only.
false, if the iterator was stopped.
warn(msg: any): void
Write warning to browser console (prepending tree info)
Member Visibility
ThemeOSLightDark
Properties $container$divfocusNodeoptionsrootNodewidget Methods activateKeyapplyPatchchangeRefKeyclearCookiesclearFiltercountdebugenableUpdateexpandAllfilterBranchesfilterNodesfindAllfindNextNodegenerateFormElementsgetActiveNodegetFirstChildgetFocusNodegetNodeByKeygetNodesByRefgetPersistDatagetRootNodegetSelectedNodeshasFocusinfoisEditingloadKeyPathreactivatereloadrendersetFocustoDictvisitwarn