Skip to content

@serenity-is/corelib / CascadedWidgetLink

Class: CascadedWidgetLink<TParent>

Defined in: src/ui/editors/cascadedwidgetlink.ts:12

Links a widget to a parent widget so that it reacts to the parent's changes, typically used for cascading select editors.

Type Parameters

TParent

TParent extends Widget<any>

The parent widget type.

Constructors

Constructor

new CascadedWidgetLink<TParent>(parentType, widget, parentChange): CascadedWidgetLink<TParent>

Defined in: src/ui/editors/cascadedwidgetlink.ts:22

Creates a cascaded widget link.

Parameters

parentType

(...args) => TParent

Constructor of the parent widget type.

widget

Widget<any>

The child widget to link.

parentChange

(p1) => void

Callback invoked when the parent changes.

Returns

CascadedWidgetLink<TParent>

Properties

[typeInfo]

static [typeInfo]: ClassTypeInfo<"Serenity.">

Defined in: src/ui/editors/cascadedwidgetlink.ts:14

Methods

bind()

bind(): TParent

Defined in: src/ui/editors/cascadedwidgetlink.ts:39

Binds the link to the parent widget and subscribes to its change event.

Returns

TParent

The parent widget, or null if not found.


get_parentID()

get_parentID(): string

Defined in: src/ui/editors/cascadedwidgetlink.ts:86

Returns the parent element id.

Returns

string

The parent id.


set_parentID()

set_parentID(value): void

Defined in: src/ui/editors/cascadedwidgetlink.ts:94

Sets the parent element id and rebinds the link.

Parameters

value

string

The parent id.

Returns

void


unbind()

unbind(): HTMLElement

Defined in: src/ui/editors/cascadedwidgetlink.ts:64

Unbinds the link from the parent widget.

Returns

HTMLElement

The parent node, or null.