Optional
activatee.node
was activated.
Optional
beforee.node
is about to be activated.
Return false
to prevent default handling, i.e. activating the node.
See also deactivate
event.
Optional
beforee.node
is about to be expanded/collapsed.
Return false
to prevent default handling, i.e. expanding/collapsing the node.
Optional
beforeReturn false
to prevent default handling, i.e. (de)selecting the node.
Optional
buttonReturn false
to prevent default handling, i.e. (de)selecting the node.
Optional
changeOptional
clickReturn false
to prevent default behavior, e.g. expand/collapse, (de)selection, or activation.
Optional
dblclickReturn false
to prevent default behavior, e.g. expand/collapse.
Optional
deactivatee.node
was deactivated.
Return false
to prevent default handling, e.g. deactivating the node
and activating the next.
See also activate
event.
Optional
discarde.node
was discarded from the viewport and its HTML markup removed.
Optional
errorAn error occurred, e.g. during initialization or lazy loading.
Optional
expande.node
was expanded (e.flag === true
) or collapsed (e.flag === false
)
Optional
focusThe tree received or lost focus.
Check e.flag
for status.
Optional
icone.node
is about to be rendered. We can add a badge to the icon cell here.
Optional
initFires 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).
Optional
keydownFires 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.
Optional
lazyFires 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.
Optional
loadFires when data was loaded (initial request, reload, or lazy loading), after the data is applied and rendered.
Optional
modifyOptional
receiveFires 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.
Optional
renderFires 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.
Optional
renderSame as render(e)
, but for the status nodes, i.e. e.node.statusNodeType
.
Optional
selecte.node
was selected (e.flag === true
) or deselected (e.flag === false
)
Optional
updateFires when the viewport content was updated, after scroling, expanding etc.
Optional
adjustIf 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
Optional
autoCollapse siblings when a node is expanded. Default: false
Optional
checkboxIf true, render a checkbox before the node tile to allow selection with the
mouse. Pass "radio"
to render a radio button instead.
Default: false.
Optional
columnsA 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.
Default: []
meaning this is a plain tree.
Optional
columnsDefault value for ColumnDefinition.filterable option. Default: false
0.11.0
Optional
columnsDefault value for ColumnDefinition.menu option. Default: false
0.11.0
Optional
columnsDefault value for ColumnDefinition.resizable option. Default: false
0.10.0
Optional
columnsDefault value for ColumnDefinition.sortable option. Default: false
0.11.0
Optional
connectHTMLElement that receives the top nodes breadcrumb. Default: undefined
Optional
debug0:quiet, 1:errors, 2:warnings, 3:info, 4:verbose Default: 3 (4 in local debug environment)
Optional
dndOptional
editThe target div
element (or selector) that shall become a Wunderbaum.
Optional
emptyIf true, allow to expand parent nodes, even if node.children
conatains
an empty array ([]
). This is the the behavior of macOS Finder, for example.
Default: false
Optional
enabledDefault: true
Optional
filterOptional
fixedDefault: false
Optional
headerShow/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
Optional
iconOptional callback to render icons per node.
Optional
iconIcon 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.
Default: "bootstrap"
Optional
iconOptional callback to render a tooltip for the icon.
Optional
idThe identifier of this tree. Used to reference the instance, especially
when multiple trees are present (e.g. tree = mar10.Wunderbaum.getTree("demo")
).
Default: "wb_" + COUNTER
.
Optional
minNumber of levels that are forced to be expanded, and have no expander icon. E.g. 1 would keep all toplevel nodes expanded. Default: 0
Optional
navigationDefault: NavModeEnum.startRow
Optional
quicksearchDefault: true
Optional
rowHeight of a node row div. Default: 22
Optional
scrollScroll Node into view on Expand Click
true
Optional
selectDefault: "multi"
Optional
showOptional
skeletonIf 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.
Default: false.
Optional
sourceDefine 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.
Default: {}
.
Optional
stringsTranslation map for some system messages.
Optional
tooltipOptional callback to render a tooltip for the node title.
Pass true
to use the node's title
property as tooltip.
Optional
typesDefine 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.
Default: {}
.
Optional
unselectableOptional 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