ViewBase
Subclass ViewBase to implement a Datagrok view in JavaScript.
Extends
Extended by
Constructors
new ViewBase()
new ViewBase(
params,path,createHost):ViewBase
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
params | null | object | null | URL parameters. |
path | string | '' | URL path. |
createHost | boolean | true | Create JS host wrapper. |
Returns
Overrides
Constructs
ViewBase
Source
Properties
| Property | Modifier | Type | Default value | Description | Overrides | Inherited from |
|---|---|---|---|---|---|---|
_closing | private | boolean | undefined | - | - | - |
_functions | protected | Func[] | [] | - | Widget._functions | Widget._functions |
_helpUrl | private | null | string | null | - | - | - |
_name | protected | string | 'New View' | - | - | - |
_properties | protected | Property[] | [] | - | Widget._properties | Widget._properties |
_root | protected | HTMLElement | undefined | - | Widget._root | Widget._root |
dart | public | any | undefined | - | Widget.dart | Widget.dart |
factory | public | null | Func | null | Constructor function. No parameters, returns [Widget]. | Widget.factory | Widget.factory |
isDetached | public | boolean | false | - | Widget.isDetached | Widget.isDetached |
props | public | any | undefined | - | Widget.props | Widget.props |
subs | public | Subscription[] | undefined | - | Widget.subs | Widget.subs |
temp | public | any | undefined | Contains auxiliary information | Widget.temp | Widget.temp |
Accessors
basePath
getbasePath():string
Deprecated
use path instead
setbasePath(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
box
getbox():boolean
setbox(b):void
Parameters
| Parameter | Type |
|---|---|
b | boolean |
Returns
boolean
Source
children
getchildren():Widget<any>[]
Parent widget up the DOM tree, or null.
Returns
Widget<any>[]
Source
closing
getclosing():boolean
Whether the view is currently closing.
setclosing(c):void
Parameters
| Parameter | Type |
|---|---|
c | boolean |
Returns
boolean
Source
description
getdescription():string
setdescription(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
entity
getentity():null|object
setentity(_e):void
Parameters
| Parameter | Type |
|---|---|
_e | null | object |
Returns
null | object
Source
helpUrl
gethelpUrl():null|string
sethelpUrl(url):void
Parameters
| Parameter | Type |
|---|---|
url | null | string |
Returns
null | string
View help URL.
Source
name
getname():string
setname(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
parent
getparent():null|Widget<any>
Parent widget up the DOM tree, or null.
Returns
null | Widget<any>
Source
parentCall
getparentCall():undefined|FuncCall
setparentCall(s):void
Parameters
| Parameter | Type |
|---|---|
s | undefined | FuncCall |
Returns
undefined | FuncCall
Source
parentView
getparentView():ViewBase
setparentView(s):void
Parameters
| Parameter | Type |
|---|---|
s | ViewBase |
Returns
Source
path
getpath():string
View URI, relative to the view root
setpath(s):void
Parameters
| Parameter | Type |
|---|---|
s | string |
Returns
string
Source
ribbonMenu
getribbonMenu():Menu
View menu. Sample: https://public.datagrok.ai/js/samples/ui/views/ribbon
setribbonMenu(menu):void
Parameters
| Parameter | Type |
|---|---|
menu | Menu |
Returns
Source
root
getroot():HTMLElement
Widget's visual root.
setroot(newRoot):void
Parameters
| Parameter | Type |
|---|---|
newRoot | HTMLElement |
Returns
HTMLElement
Source
statusBarPanels
getstatusBarPanels():HTMLDivElement[]
Status bar panels to be shown on the bottom
setstatusBarPanels(panels):void
Parameters
| Parameter | Type |
|---|---|
panels | HTMLDivElement[] |
Returns
HTMLDivElement[]
Source
toolbox
gettoolbox():HTMLElement
View toolbox. Sample: https://public.datagrok.ai/js/samples/ui/views/toolbox
settoolbox(x):void
Parameters
| Parameter | Type |
|---|---|
x | HTMLElement |
Returns
HTMLElement
Source
type
gettype():string
View type
Returns
string
Source
Methods
acceptsPath()
acceptsPath(
_urlPath):boolean
Checks if URL path is acceptable. Override in subclasses.
Parameters
| Parameter | Type |
|---|---|
_urlPath | string |
Returns
boolean
"true" if path is acceptable, "false" otherwise.
Source
addProperty()
privateaddProperty(propertyName,propertyType,defaultValue,options):any
Registers an property with the specified type, name, and defaultValue.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
propertyName | string | undefined | |
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 | |
defaultValue | any | null | |
options | null | object & IProperty | null |
Returns
any
Inherited from
See
Registered property gets added to properties. Returns default value, thus allowing to combine registering a property with the initialization
Source
append()
append(
item):HTMLElement
Appends an item to this view. Use appendAll for appending multiple elements.
Parameters
| Parameter | Type | Description |
|---|---|---|
item | any |
Returns
HTMLElement
Source
appendAll()
appendAll(
items):HTMLElement
Appends multiple elements this view. Use append for appending a single element.
Parameters
| Parameter | Type | Description |
|---|---|---|
items | HTMLElement[] |
Returns
HTMLElement
Source
apply()
apply(
properties):Widget<any>
Parameters
| Parameter | Type | Description |
|---|---|---|
properties | object |
Returns
Widget<any>
Inherited from
Source
close()
close():
void
Closes this view.
Returns
void
Source
detach()
detach():
void
Detaches this view.
Returns
void
Overrides
Source
getDartProperties()
getDartProperties():
any[]
Returns
any[]
Inherited from
Source
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
Source
getIcon()
getIcon():
null|HTMLElement
Returns
null | HTMLElement
View icon. Override in subclasses.
Source
getProperties()
getProperties():
Property[]
Returns all properties of this widget.
Returns
Property[]
Inherited from
Source
getRibbonPanels()
getRibbonPanels():
HTMLElement[][]
Returns
HTMLElement[][]
Source
handlePath()
handlePath(
_urlPath):void
Handles URL path. Override in subclasses.
Parameters
| Parameter | Type |
|---|---|
_urlPath | string |
Returns
void
Source
loadStateMap()
loadStateMap(
_stateMap):void
Loads view state map. Override in subclasses.
Parameters
| Parameter | Type |
|---|---|
_stateMap | object |
Returns
void
Source
onFrameAttached()
onFrameAttached(
dataFrame):void
Parameters
| Parameter | Type |
|---|---|
dataFrame | DataFrame |
Returns
void
Inherited from
Source
onPropertyChanged()
onPropertyChanged(
property):void
Gets called when viewer's property is changed.
Parameters
| Parameter | Type | Description |
|---|---|---|
property | null | Property | or null, if multiple properties were changed. |
Returns
void
Inherited from
Source
saveStateMap()
saveStateMap():
null|object
Returns
null | object
Viewer state map. Override in subclasses.
Source
setIcon()
setIcon(
icon):void
Parameters
| Parameter | Type |
|---|---|
icon | HTMLElement |
Returns
void
Source
setRibbonPanels()
setRibbonPanels(
panels,clear):void
Sets custom view panels on the ribbon.
Parameters
| Parameter | Type | Default value | Description |
|---|---|---|---|
panels | HTMLElement[][] | undefined | |
clear | boolean | true | Clear all previous before setup Sample: https://public.datagrok.ai/js/samples/ui/views/ribbon |
Returns
void
Source
sourceRowsChanged()
sourceRowsChanged():
void
Returns
void
Inherited from
Source
sub()
sub(
subscription):void
Registers a subscription to an external event.
Parameters
| Parameter | Type | Description |
|---|---|---|
subscription | Subscription |
Returns
void
Inherited from
Source
toDart()
toDart():
any
Returns
any
Inherited from
Source
find()
staticfind(root):null|Widget<any>
Finds existing widget from its visual root.
Parameters
| Parameter | Type |
|---|---|
root | Element |
Returns
null | Widget<any>
Inherited from
Source
fromRoot()
staticfromRoot(root):Widget<any>
Creates a new widget from the root element.
Parameters
| Parameter | Type |
|---|---|
root | HTMLElement |
Returns
Widget<any>
Inherited from
Source
getAll()
staticgetAll():Widget<any>[]
Returns all currently active widgets.
Returns
Widget<any>[]