Skip to main content

Widget<TSettings>

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

Extended by

Type parameters

Type parameterValue
TSettingsany

Constructors

new Widget()

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

Parameters

ParameterType
widgetRootHTMLElement

Returns

Widget<TSettings>

Constructs

Widget and initializes its root.

Source

src/widgets.ts:223

Properties

PropertyModifierTypeDefault valueDescription
_functionsprotectedFunc[][]-
_propertiesprotectedProperty[][]-
_rootprotectedHTMLElementundefined-
dartpublicanyundefined-
factorypublicnull | FuncnullConstructor function. No parameters, returns [Widget].
isDetachedpublicbooleanfalse-
propspublicTSettings & ObjectPropertyBagundefined-
subspublicSubscription[]undefined-
temppublicanyundefinedContains auxiliary information

Accessors

children

get children(): Widget<any>[]

Parent widget up the DOM tree, or null.

Returns

Widget<any>[]

Source

src/widgets.ts:293


parent

get parent(): null | Widget<any>

Parent widget up the DOM tree, or null.

Returns

null | Widget<any>

Source

src/widgets.ts:290


root

get root(): HTMLElement

Widget's visual root.

set root(r): void

Parameters

ParameterType
rHTMLElement

Returns

HTMLElement

Source

src/widgets.ts:297


type

get type(): string

Returns

string

Source

src/widgets.ts:206

Methods

addProperty()

private addProperty(propertyName, propertyType, defaultValue, options): any

Registers an property with the specified type, name, and defaultValue.

Parameters

ParameterTypeDefault valueDescription
propertyNamestringundefined
propertyType"string" | "bigint" | "object" | "map" | "file" | "view" | "blob" | "int" | "double" | "bool" | "byte_array" | "datetime" | "qnum" | "dataframe" | "num" | "string_list" | "dataframe_list" | "cell" | "column" | "column_list" | "graphics" | "tablerowfiltercall" | "colfiltercall" | "bitset" | "dynamic" | "viewer" | "list" | "semantic_value" | "func" | "funccall" | "property" | "categorical" | "numerical" | "GridCellRenderArgs" | "element" | "TableView" | "User" | "Menu" | "Project" | "event_data" | "progressindicator" | "Credentials" | "ScriptEnvironment" | "Notebook"undefined
defaultValueanynull
optionsnull | object & IPropertynull

Returns

any

See

Registered property gets added to properties. Returns default value, thus allowing to combine registering a property with the initialization

Source

src/widgets.ts:318


apply()

apply(properties): Widget<any>

Parameters

ParameterTypeDescription
propertiesobject

Returns

Widget<any>

Source

src/widgets.ts:257


detach()

detach(): void

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

Source

src/widgets.ts:302


getDartProperties()

getDartProperties(): any[]

Returns

any[]

Source

src/widgets.ts:278


getFunctions()

getFunctions(): Func[]

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

Returns

Func[]

Source

src/widgets.ts:272


getProperties()

getProperties(): Property[]

Returns all properties of this widget.

Returns

Property[]

Source

src/widgets.ts:268


onFrameAttached()

onFrameAttached(dataFrame): void

Parameters

ParameterType
dataFrameDataFrame

Returns

void

Source

src/widgets.ts:284


onPropertyChanged()

onPropertyChanged(property): void

Gets called when viewer's property is changed.

Parameters

ParameterTypeDescription
propertynull | Propertyor null, if multiple properties were changed.

Returns

void

Source

src/widgets.ts:276


sourceRowsChanged()

sourceRowsChanged(): void

Returns

void

Source

src/widgets.ts:282


sub()

sub(subscription): void

Registers a subscription to an external event.

Parameters

ParameterTypeDescription
subscriptionSubscription

Returns

void

Source

src/widgets.ts:250


toDart()

toDart(): any

Returns

any

Source

src/widgets.ts:242


find()

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

Finds existing widget from its visual root.

Parameters

ParameterType
rootElement

Returns

null | Widget<any>

Source

src/widgets.ts:238


fromRoot()

static fromRoot(root): Widget<any>

Creates a new widget from the root element.

Parameters

ParameterType
rootHTMLElement

Returns

Widget<any>

Source

src/widgets.ts:341


getAll()

static getAll(): Widget<any>[]

Returns all currently active widgets.

Returns

Widget<any>[]

Source

src/widgets.ts:233