Interface WbRenderEventType

interface WbRenderEventType {
    allColInfosById: ColumnEventInfoMap;
    event?: Event;
    isColspan: boolean;
    isNew: boolean;
    node: WunderbaumNode;
    nodeElem: HTMLSpanElement;
    renderColInfosById: ColumnEventInfoMap;
    tree: Wunderbaum;
    type: string;
    typeInfo: NodeTypeDefinition;
    util: any;
}

Hierarchy (view full)

Properties

allColInfosById: ColumnEventInfoMap

Array of node's <span class='wb-col'> elements. The first element is <span class='wb-node wb-col'>, which contains the node title and icon (idx: 0, id: '*'`).

event?: Event

Originating HTML event if any (e.g. click).

isColspan: boolean

True if the node only displays the title and is stretched over all remaining columns.

isNew: boolean

True if the node's markup was not yet created. In this case the render event should create embedded input controls (in addition to update the values according to to current node data).
False if the node's markup was already created. In this case the render event should only update the values according to to current node data.

The affected target node.

nodeElem: HTMLSpanElement

The node's <span class='wb-node'> element.

renderColInfosById: ColumnEventInfoMap

Array of node's <span class='wb-node'> elements, that should be rendered by the event handler. In contrast to allColInfosById, the node title is not part of this array. If node.isColspan() is true, this array is empty ([]). This allows to iterate over all relevant in a simple loop:

for (const col of Object.values(e.renderColInfosById)) {
switch (col.id) {
default:
// Assumption: we named column.id === node.data.NAME
col.elem.textContent = node.data[col.id];
break;
}
}

The affected tree instance.

type: string

Name of the event.

Contains the node's type information, i.e. tree.types[node.type] if defined. Set to {} otherwise.

util: any

Exposed utility module methods (see API docs).