Skip to main content

Widget<TSettings>

Defined in: js-api/src/widgets/base.ts:265

Base class for controls that have a visual root and a set of properties.

Extended by

Type Parameters

Type ParameterDefault type
TSettingsany

Constructors

Constructor

new Widget<TSettings>(widgetRoot): Widget<TSettings>

Defined in: js-api/src/widgets/base.ts:284

Parameters

ParameterType
widgetRootHTMLElement

Returns

Widget<TSettings>

Constructs

Widget and initializes its root.

Properties

PropertyModifierTypeDefault valueDescriptionDefined in
_functionsprotectedFunc[][]-js-api/src/widgets/base.ts:277
_propertiesprotectedProperty[][]-js-api/src/widgets/base.ts:276
_rootprotectedHTMLElementundefined-js-api/src/widgets/base.ts:275
dartpublicanyundefined-js-api/src/widgets/base.ts:280
factorypublicFunc | nullnullConstructor function. No parameters, returns [Widget].js-api/src/widgets/base.ts:273
isDetachedpublicbooleanfalse-js-api/src/widgets/base.ts:281
propspublicTSettings & ObjectPropertyBagundefined-js-api/src/widgets/base.ts:278
subspublicSubscription[]undefined-js-api/src/widgets/base.ts:279
temppublicanyundefinedContains auxiliary informationjs-api/src/widgets/base.ts:270

Accessors

aiDescription

Get Signature

get aiDescription(): string | null

Defined in: js-api/src/widgets/base.ts:340

A short AI-facing briefing: what this widget is, what its functions do, and how the assistant should approach it (e.g. which getFunctions entries to call first). Shown to the AI assistant as part of the workspace context.

Returns

string | null

Set Signature

set aiDescription(x): void

Defined in: js-api/src/widgets/base.ts:341

Parameters
ParameterType
xstring | null
Returns

void


children

Get Signature

get children(): Widget<any>[]

Defined in: js-api/src/widgets/base.ts:362

Parent widget up the DOM tree, or null.

Returns

Widget<any>[]


parent

Get Signature

get parent(): Widget<any> | null

Defined in: js-api/src/widgets/base.ts:359

Parent widget up the DOM tree, or null.

Returns

Widget<any> | null


root

Get Signature

get root(): HTMLElement

Defined in: js-api/src/widgets/base.ts:366

Widget's visual root.

Returns

HTMLElement

Set Signature

set root(r): void

Defined in: js-api/src/widgets/base.ts:367

Parameters
ParameterType
rHTMLElement
Returns

void


type

Get Signature

get type(): string

Defined in: js-api/src/widgets/base.ts:267

Returns

string

Methods

apply()

apply(properties): Widget

Defined in: js-api/src/widgets/base.ts:318

Parameters

ParameterTypeDescription
propertiesobject-

Returns

Widget


detach()

detach(): void

Defined in: js-api/src/widgets/base.ts:371

Gets called when a widget is detached and will no longer be used. Typically used for unsubscribing from events. Be sure to call super.detach() if this method is overridden.

Returns

void


getDartProperties()

getDartProperties(): any[]

Defined in: js-api/src/widgets/base.ts:347

Returns

any[]


getFunctions()

getFunctions(): Func[]

Defined in: js-api/src/widgets/base.ts:333

Functions that are applicable to this particular widget. Used in the UI to display context actions, and for the AI integrations.

Returns

Func[]


getProperties()

getProperties(): Property[]

Defined in: js-api/src/widgets/base.ts:329

Returns all properties of this widget.

Returns

Property[]


getWidgetStatus()

getWidgetStatus(): IWidgetStatus

Defined in: js-api/src/widgets/base.ts:418

Returns the widget's runtime structure for automated testing and introspection.

Returns

IWidgetStatus


onEvent()

onEvent(eventId?): Observable<any>

Defined in: js-api/src/widgets/base.ts:415

Observes events with the specified eventId. Override in subclasses to provide actual events.

Parameters

ParameterTypeDefault value
eventIdstring | nullnull

Returns

Observable<any>


onFrameAttached()

onFrameAttached(dataFrame): void

Defined in: js-api/src/widgets/base.ts:353

Parameters

ParameterType
dataFrameDataFrame

Returns

void


onPropertyChanged()

onPropertyChanged(property): void

Defined in: js-api/src/widgets/base.ts:345

Gets called when viewer's property is changed.

Parameters

ParameterTypeDescription
propertyProperty | nullor null, if multiple properties were changed.

Returns

void


sourceRowsChanged()

sourceRowsChanged(): void

Defined in: js-api/src/widgets/base.ts:351

Returns

void


sub()

sub(subscription): void

Defined in: js-api/src/widgets/base.ts:311

Registers a subscription to an external event.

Parameters

ParameterTypeDescription
subscriptionSubscription-

Returns

void


toDart()

toDart(): any

Defined in: js-api/src/widgets/base.ts:303

Returns

any


find()

static find(root): Widget<any> | null

Defined in: js-api/src/widgets/base.ts:299

Finds existing widget from its visual root.

Parameters

ParameterType
rootElement

Returns

Widget<any> | null


fromRoot()

static fromRoot(root): Widget

Defined in: js-api/src/widgets/base.ts:421

Creates a new widget from the root element.

Parameters

ParameterType
rootHTMLElement

Returns

Widget


getAll()

static getAll(): Widget<any>[]

Defined in: js-api/src/widgets/base.ts:294

Returns all currently active widgets.

Returns

Widget<any>[]