@serenity-is/corelib / CreateWidgetParams
Interface: CreateWidgetParams<TWidget, P>
Defined in: src/ui/widgets/widget.ts:576
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:582
The container to append the widget's element to.
element()?
optionalelement: (e) =>void
Defined in: src/ui/widgets/widget.ts:584
Callback invoked with the created element.
Parameters
e
Returns
void
init()?
optionalinit: (w) =>void
Defined in: src/ui/widgets/widget.ts:586
Callback invoked after the widget is initialized.
Parameters
w
TWidget
Returns
void
options?
optionaloptions:P&object
Defined in: src/ui/widgets/widget.ts:580
The options to pass to the widget.
Type Declaration
class?
optionalclass:string
Optional CSS class(es) for the widget's DOM node.
deferInit?
optionaldeferInit:boolean
Asks a widget whose class has Attributes.deferInit("optional") to defer its initialization (true), or to
initialize in its constructor (false), as its creator can wait for it, e.g. a form that defers its own, or
can't. The other classes ignore it, see Widget.isDeferredInit.
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:578
The widget type to instantiate.
Parameters
options?
P
Returns
TWidget
prototype
prototype:
TWidget