@serenity-is/corelib / CreateWidgetParams
Interface: CreateWidgetParams<TWidget, P>
Defined in: src/ui/widgets/widget.ts:380
Parameters for Widget.create.
Type Parameters
TWidget
TWidget extends Widget<P>
The widget type to create.
P
P
The widget's options type.
Properties
container?
optionalcontainer:HTMLElement|ArrayLike<HTMLElement>
Defined in: src/ui/widgets/widget.ts:386
The container to append the widget's element to.
element()?
optionalelement: (e) =>void
Defined in: src/ui/widgets/widget.ts:388
Callback invoked with the created element.
Parameters
e
Returns
void
init()?
optionalinit: (w) =>void
Defined in: src/ui/widgets/widget.ts:390
Callback invoked after the widget is initialized.
Parameters
w
TWidget
Returns
void
options?
optionaloptions:P&object
Defined in: src/ui/widgets/widget.ts:384
The options to pass to the widget.
Type Declaration
class?
optionalclass:string
Optional CSS class(es) for the widget's DOM node.
element?
optionalelement:string|HTMLElement|ArrayLike<HTMLElement> | (el) =>void
The element to bind the widget to, as an element, array-like, selector or a callback that receives the created element.
id?
optionalid:string
Optional id for the widget's DOM node.
type?
optionaltype: {(options?):TWidget;prototype:TWidget; }
Defined in: src/ui/widgets/widget.ts:382
The widget type to instantiate.
Parameters
options?
P
Returns
TWidget
prototype
prototype:
TWidget