Optionalactivatee.node was activated.
Optionalbeforee.node is about to be activated.
Return false to prevent default handling, i.e. activating the node.
See also deactivate event.
Optionalbeforee.node is about to be expanded/collapsed.
Return false to prevent default handling, i.e. expanding/collapsing the node.
OptionalbeforeReturn false to prevent default handling, i.e. (de)selecting the node.
OptionalbuttonReturn false to prevent default handling, i.e. (de)selecting the node.
OptionalchangeOptionalclickReturn false to prevent default behavior, e.g. expand/collapse, (de)selection, or activation.
OptionaldblclickReturn false to prevent default behavior, e.g. expand/collapse.
Optionaldeactivatee.node was deactivated.
Return false to prevent default handling, e.g. deactivating the node
and activating the next.
See also activate event.
Optionaldiscarde.node was discarded from the viewport and its HTML markup removed.
OptionalerrorAn error occurred, e.g. during initialization or lazy loading.
Optionalexpande.node was expanded (e.flag === true) or collapsed (e.flag === false)
OptionalfocusThe tree received or lost focus.
Check e.flag for status.
Optionalicone.node is about to be rendered. We can add a badge to the icon cell here.
OptionalinitFires when the tree markup was created and the initial source data was loaded.
Typical use cases would be activating a node, setting focus, enabling other
controls on the page, etc.
Also sent if an error occured during initialization (check e.error for status).
OptionalkeydownFires when a key was pressed while the tree has focus.
e.node is set if a node is currently active.
Return false to prevent default navigation.
OptionallazyFires when a node that was marked 'lazy', is expanded for the first time. Typically we return an endpoint URL or the Promise of a fetch request that provides a (potentially nested) list of child nodes.
OptionalloadFires when data was loaded (initial request, reload, or lazy loading), after the data is applied and rendered.
OptionalmodifyOptionalreceiveFires when data was fetched (initial request, reload, or lazy loading), but before the data is applied and rendered. Here we can modify and adjust the received data, for example to convert an external response to native Wunderbaum syntax.
OptionalrenderFires when a node is about to be displayed.
The default HTML markup is already created, but not yet added to the DOM.
Now we can tweak the markup, create HTML elements in this node's column
cells, etc.
See also Custom Rendering for details.
OptionalrenderSame as render(e), but for the status nodes, i.e. e.node.statusNodeType.
Optionalselecte.node was selected (e.flag === true) or deselected (e.flag === false)
OptionalupdateFires when the viewport content was updated, after scroling, expanding etc.
OptionaladjustIf true, the tree will automatically adjust its height to fit the parent
container. This is useful when the tree is embedded in a container with
a fixed or calculated sized.
If the parent container is unsized (e.g. grows with its content, height: auto),
then we can define a height: ... or max_height: ... style on the parent.
To avoid a recursive resize-loop, it may be helpful to set overflow: hidden
on the parent container.
Set this option to false will disable auto-resizing.
@default: true
OptionalautoCollapse siblings when a node is expanded.
OptionalautoGenerate missing keys by hashing a combination of refKey (or title) and the parent key. This is useful when the source data does not contain unique keys but we want stable keys for persisting the active node, selection or expansion state. Note that this still assumes that the same refKey must not appear twice in the same parent node.
OptionalcheckboxIf true, render a checkbox before the node tile to allow selection with the
mouse. Pass "radio" to render a radio button instead.
OptionalcolumnsA list of maps that define column headers. If this option is set,
Wunderbaum becomes a treegrid control instead of a plain tree.
Column definitions can be passed as tree option, or be part of a source
response.
OptionalcolumnsDefault value for ColumnDefinition.filterable option.
OptionalcolumnsDefault value for ColumnDefinition.menu option.
OptionalcolumnsDefault value for ColumnDefinition.resizable option.
OptionalcolumnsDefault value for ColumnDefinition.sortable option.
OptionalconnectHTMLElement or selector that receives the top nodes breadcrumb.
Optionaldebug0:quiet, 1:errors, 2:warnings, 3:info, 4:verbose
OptionaldndConfiguration options for the drag-and-drop extension.
OptionaleditConfiguration options for the edit-title extension.
The target div element (or selector) that shall become a Wunderbaum.
OptionalemptyIf true, allow to expand parent nodes, even if node.children conatains
an empty array ([]). This is the the behavior of macOS Finder, for example.
OptionalenabledOptionalfilterConfiguration options for the node-filter extension.
OptionalfixedOptionalheaderShow/hide header (default: null) null: assume false for plain tree and true for grids. string: use text as header (only for plain trees) true: display a header (use tree's id as text for plain trees) false: do not display a header
OptionaliconOptional callback to render icons per node.
OptionaliconIcon font definition. May be a string (e.g. "fontawesome6" or "bootstrap")
or a map of iconName: iconClass pairs.
Note: the icon font must be loaded separately.
In order to only override some defauöt icons, use this pattern:
const tree = new mar10.Wunderbaum({
...
iconMap: Object.assign(Wunderbaum.iconMaps.bootstrap, {
folder: "bi bi-archive",
}),
});
OptionaliconOptional callback to render a tooltip for the icon.
OptionalidThe identifier of this tree. Used to reference the instance, especially
when multiple trees are present (e.g. tree = mar10.Wunderbaum.getTree("demo")).
OptionalminNumber of levels that are forced to be expanded, and have no expander icon. E.g. 1 would keep all toplevel nodes expanded.
OptionalnavigationOptionalquicksearchOptionalrowHeight of a node row div.
OptionalscrollScroll Node into view on Expand Click
OptionalselectOptionalshowShow a <progress> element while loading data.
OptionalskeletonIf true, add a wb-skeleton class to all nodes, that will result in a
'glow' effect. Typically used with initial dummy nodes, while loading the
real data.
OptionalsortGroup nodes with children or of type: 'folder' at the top when sorting.
If a function is passed, it is called with the node as argument to determine
whether the node is a folder or not. The function should return true for
folders.
and should return true for folders.
OptionalsourceDefine the initial tree data. Typically a URL of an endpoint that serves a JSON formatted structure, but also a callback, Promise, or static data is allowed.
OptionalstringsTranslation map for some system messages.
OptionaltooltipOptional callback to render a tooltip for the node title.
Pass true to use the node's title property as tooltip.
OptionaltypesDefine shared attributes for multiple nodes of the same type.
This allows for more compact data models. Type definitions can be passed
as tree option, or be part of a source response.
OptionalunselectableOptional callback to make a node unselectable.
Available options for wunderbaum.Wunderbaum.
Options are passed to the constructor as plain object:
Event handlers are also passed as callbacks
Most of the properties are optional and have resonable default. They are then available as Wunderbaum.options property and can be changed at runtime.
Only the
elementoption is mandatory.Note that some options passed here, are not available as Wunderbaum.options. They are moved to the
treeinstance instead:tree.elementtree.idtree.columnstree.typesSome options are only used during initialization and are not stored in the tree instance:
source