Skip to main content

ViewBase

Subclass ViewBase to implement a Datagrok view in JavaScript.

Extends

Extended by

Constructors

new ViewBase()

new ViewBase(params, path, createHost): ViewBase

Parameters

ParameterTypeDefault valueDescription
paramsnull | objectnullURL parameters.
pathstring''URL path.
createHostbooleantrueCreate JS host wrapper.

Returns

ViewBase

Overrides

Widget . constructor

Constructs

ViewBase

Source

src/views/view.ts:57

Properties

PropertyModifierTypeDefault valueDescriptionOverridesInherited from
_closingprivatebooleanundefined---
_functionsprotectedFunc[][]-Widget._functionsWidget._functions
_helpUrlprivatenull | stringnull---
_nameprotectedstring'New View'---
_propertiesprotectedProperty[][]-Widget._propertiesWidget._properties
_rootprotectedHTMLElementundefined-Widget._rootWidget._root
dartpublicanyundefined-Widget.dartWidget.dart
factorypublicnull | FuncnullConstructor function. No parameters, returns [Widget].Widget.factoryWidget.factory
isDetachedpublicbooleanfalse-Widget.isDetachedWidget.isDetached
propspublicanyundefined-Widget.propsWidget.props
subspublicSubscription[]undefined-Widget.subsWidget.subs
temppublicanyundefinedContains auxiliary informationWidget.tempWidget.temp

Accessors

basePath

get basePath(): string

Deprecated

use path instead

set basePath(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/views/view.ts:126


box

get box(): boolean

set box(b): void

Parameters

ParameterType
bboolean

Returns

boolean

Source

src/views/view.ts:74


children

get children(): Widget<any>[]

Parent widget up the DOM tree, or null.

Returns

Widget<any>[]

Source

src/widgets.ts:293


closing

get closing(): boolean

Whether the view is currently closing.

set closing(c): void

Parameters

ParameterType
cboolean

Returns

boolean

Source

src/views/view.ts:144


description

get description(): string

set description(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/views/view.ts:119


entity

get entity(): null | object

set entity(_e): void

Parameters

ParameterType
_enull | object

Returns

null | object

Source

src/views/view.ts:122


helpUrl

get helpUrl(): null | string

set helpUrl(url): void

Parameters

ParameterType
urlnull | string

Returns

null | string

View help URL.

Source

src/views/view.ts:89


name

get name(): string

set name(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/views/view.ts:104


parent

get parent(): null | Widget<any>

Parent widget up the DOM tree, or null.

Returns

null | Widget<any>

Source

src/widgets.ts:290


parentCall

get parentCall(): undefined | FuncCall

set parentCall(s): void

Parameters

ParameterType
sundefined | FuncCall

Returns

undefined | FuncCall

Source

src/views/view.ts:113


parentView

get parentView(): ViewBase

set parentView(s): void

Parameters

ParameterType
sViewBase

Returns

ViewBase

Source

src/views/view.ts:116


path

get path(): string

View URI, relative to the view root

set path(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/views/view.ts:171


ribbonMenu

get ribbonMenu(): Menu

View menu. Sample: https://public.datagrok.ai/js/samples/ui/views/ribbon

set ribbonMenu(menu): void

Parameters

ParameterType
menuMenu

Returns

Menu

Source

src/views/view.ts:136


root

get root(): HTMLElement

Widget's visual root.

set root(newRoot): void

Parameters

ParameterType
newRootHTMLElement

Returns

HTMLElement

Source

src/views/view.ts:71


statusBarPanels

get statusBarPanels(): HTMLDivElement[]

Status bar panels to be shown on the bottom

set statusBarPanels(panels): void

Parameters

ParameterType
panelsHTMLDivElement[]

Returns

HTMLDivElement[]

Source

src/views/view.ts:140


toolbox

get toolbox(): HTMLElement

View toolbox. Sample: https://public.datagrok.ai/js/samples/ui/views/toolbox

set toolbox(x): void

Parameters

ParameterType
xHTMLElement

Returns

HTMLElement

Source

src/views/view.ts:131


type

get type(): string

View type

Returns

string

Source

src/views/view.ts:84

Methods

acceptsPath()

acceptsPath(_urlPath): boolean

Checks if URL path is acceptable. Override in subclasses.

Parameters

ParameterType
_urlPathstring

Returns

boolean

"true" if path is acceptable, "false" otherwise.

Source

src/views/view.ts:179


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

Inherited from

Widget . addProperty

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


append()

append(item): HTMLElement

Appends an item to this view. Use appendAll for appending multiple elements.

Parameters

ParameterTypeDescription
itemany

Returns

HTMLElement

Source

src/views/view.ts:184


appendAll()

appendAll(items): HTMLElement

Appends multiple elements this view. Use append for appending a single element.

Parameters

ParameterTypeDescription
itemsHTMLElement[]

Returns

HTMLElement

Source

src/views/view.ts:191


apply()

apply(properties): Widget<any>

Parameters

ParameterTypeDescription
propertiesobject

Returns

Widget<any>

Inherited from

Widget . apply

Source

src/widgets.ts:257


close()

close(): void

Closes this view.

Returns

void

Source

src/views/view.ts:201


detach()

detach(): void

Detaches this view.

Returns

void

Overrides

Widget . detach

Source

src/views/view.ts:196


getDartProperties()

getDartProperties(): any[]

Returns

any[]

Inherited from

Widget . getDartProperties

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[]

Inherited from

Widget . getFunctions

Source

src/widgets.ts:272


getIcon()

getIcon(): null | HTMLElement

Returns

null | HTMLElement

View icon. Override in subclasses.

Source

src/views/view.ts:160


getProperties()

getProperties(): Property[]

Returns all properties of this widget.

Returns

Property[]

Inherited from

Widget . getProperties

Source

src/widgets.ts:268


getRibbonPanels()

getRibbonPanels(): HTMLElement[][]

Returns

HTMLElement[][]

Source

src/views/view.ts:155


handlePath()

handlePath(_urlPath): void

Handles URL path. Override in subclasses.

Parameters

ParameterType
_urlPathstring

Returns

void

Source

src/views/view.ts:175


loadStateMap()

loadStateMap(_stateMap): void

Loads view state map. Override in subclasses.

Parameters

ParameterType
_stateMapobject

Returns

void

Source

src/views/view.ts:168


onFrameAttached()

onFrameAttached(dataFrame): void

Parameters

ParameterType
dataFrameDataFrame

Returns

void

Inherited from

Widget . onFrameAttached

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

Inherited from

Widget . onPropertyChanged

Source

src/widgets.ts:276


saveStateMap()

saveStateMap(): null | object

Returns

null | object

Viewer state map. Override in subclasses.

Source

src/views/view.ts:165


setIcon()

setIcon(icon): void

Parameters

ParameterType
iconHTMLElement

Returns

void

Source

src/views/view.ts:162


setRibbonPanels()

setRibbonPanels(panels, clear): void

Sets custom view panels on the ribbon.

Parameters

ParameterTypeDefault valueDescription
panelsHTMLElement[][]undefined
clearbooleantrueClear all previous before setup Sample: https://public.datagrok.ai/js/samples/ui/views/ribbon

Returns

void

Source

src/views/view.ts:151


sourceRowsChanged()

sourceRowsChanged(): void

Returns

void

Inherited from

Widget . sourceRowsChanged

Source

src/widgets.ts:282


sub()

sub(subscription): void

Registers a subscription to an external event.

Parameters

ParameterTypeDescription
subscriptionSubscription

Returns

void

Inherited from

Widget . sub

Source

src/widgets.ts:250


toDart()

toDart(): any

Returns

any

Inherited from

Widget . toDart

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>

Inherited from

Widget . find

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>

Inherited from

Widget . fromRoot

Source

src/widgets.ts:341


getAll()

static getAll(): Widget<any>[]

Returns all currently active widgets.

Returns

Widget<any>[]

Inherited from

Widget . getAll

Source

src/widgets.ts:233