Skip to main content

View

A view is typically docked in the main document area of the Grok platform. See [TableView], [SketchView], etc

Extends

Extended by

Constructors

new View()

new View(dart): View

Parameters

ParameterType
dartany

Returns

View

Overrides

ViewBase . constructor

Constructs

View

Source

src/views/view.ts:221

Properties

PropertyModifierTypeDefault valueDescriptionInherited from
_nameprotectedstring'New View'-ViewBase._name
_rootprotectedHTMLElementundefined-ViewBase._root
dartpublicanyundefined-ViewBase.dart
subspublicSubscription[]undefined-ViewBase.subs
temppublicanyundefinedContains auxiliary information-
ALL_VIEW_TYPESreadonlystring[]...--
APPSreadonly"apps"'apps'--
BROWSEreadonly"browse"'browse'--
DATABASESreadonly"databases"'databases'--
DATA_CONNECTIONSreadonly"connections"'connections'--
DATA_JOB_RUNSreadonly"jobs"'jobs'--
DATA_QUERY_RUNSreadonly"queryruns"'queryruns'--
EMAILSreadonly"emails"'emails'--
FILESreadonly"files"'files'--
FORUMreadonly"forum"'forum'--
FUNCTIONSreadonly"functions"'functions'--
GROUPSreadonly"groups"'groups'--
HELPreadonly"help"'help'--
JS_EDITORreadonly"js"'js'--
MODELSreadonly"models"'models'--
NOTEBOOKSreadonly"notebooks"'notebooks'--
OPEN_TEXTreadonly"text"'text'--
PACKAGESreadonly"packages"'packages'--
PACKAGE_REPOSITORIESreadonly"repositories"'repositories'--
PROJECTSreadonly"projects"'projects'--
QUERIESreadonly"queries"'queries'--
SCRIPTreadonly"script"'script'--
SCRIPTSreadonly"scripts"'scripts'--
SETTINGSreadonly"settings"'settings'--
SKETCHreadonly"sketch"'sketch'--
USERSreadonly"users"'users'--
VIEW_LAYOUTSreadonly"layouts"'layouts'--
WEB_SERVICESreadonly"webservices"'webservices'--
WELCOMEreadonly"welcome"'welcome'--

Accessors

basePath

get basePath(): string

Deprecated

use path instead

set basePath(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/views/view.ts:131


box

get box(): boolean

set box(b): void

Parameters

ParameterType
bboolean

Returns

boolean

Source

src/views/view.ts:77


closing

get closing(): boolean

Whether the view is currently closing.

set closing(c): void

Parameters

ParameterType
cboolean

Returns

boolean

Source

src/views/view.ts:149


description

get description(): string

set description(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/views/view.ts:277


entity

get entity(): null | object

set entity(_e): void

Parameters

ParameterType
_enull | object

Returns

null | object

Source

src/views/view.ts:127


helpUrl

get helpUrl(): null | string

set helpUrl(url): void

Parameters

ParameterType
urlnull | string

Returns

null | string

View help URL.

Source

src/views/view.ts:286


id

get id(): string

Returns

string

Source

src/views/view.ts:273


name

get name(): string

View name. It gets shown in the tab handle.

set name(s): void

Parameters

ParameterType
sstring

Returns

string

Source

src/views/view.ts:319


parentCall

get parentCall(): undefined | FuncCall

set parentCall(s): void

Parameters

ParameterType
sundefined | FuncCall

Returns

undefined | FuncCall

Source

src/views/view.ts:118


parentView

get parentView(): ViewBase

set parentView(s): void

Parameters

ParameterType
sViewBase

Returns

ViewBase

Source

src/views/view.ts:121


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:174


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:141


root

get root(): HTMLElement

Returns

HTMLElement

Source

src/views/view.ts:265


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:145


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:136


type

get type(): string

View type

Returns

string

Source

src/views/view.ts:269

Methods

_onAdded()

_onAdded(): void

Returns

void

Source

src/views/view.ts:332


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.

Inherited from

ViewBase . acceptsPath

Source

src/views/view.ts:182


append()

append(item): HTMLElement

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

Parameters

ParameterTypeDescription
itemany

Returns

HTMLElement

Inherited from

ViewBase . append

Source

src/views/view.ts:187


appendAll()

appendAll(items): HTMLElement

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

Parameters

ParameterTypeDescription
itemsHTMLElement[]

Returns

HTMLElement

Inherited from

ViewBase . appendAll

Source

src/views/view.ts:194


close()

close(): void

Closes this view.

Returns

void

Inherited from

ViewBase . close

Source

src/views/view.ts:204


detach()

detach(): void

Detaches this view.

Returns

void

Inherited from

ViewBase . detach

Source

src/views/view.ts:199


getIcon()

getIcon(): null | HTMLElement

Returns

null | HTMLElement

View icon. Override in subclasses.

Inherited from

ViewBase . getIcon

Source

src/views/view.ts:165


getInfo()

getInfo(): ViewLayout

Saves view as a ViewInfo. Only applicable to certain views, such as TableView.

Returns

ViewLayout

Source

src/views/view.ts:312


getRibbonPanels()

getRibbonPanels(): HTMLElement[][]

Returns

HTMLElement[][]

Inherited from

ViewBase . getRibbonPanels

Source

src/views/view.ts:160


handlePath()

handlePath(_urlPath): void

Handles URL path. Override in subclasses.

Parameters

ParameterType
_urlPathstring

Returns

void

Inherited from

ViewBase . handlePath

Source

src/views/view.ts:178


loadLayout()

loadLayout(layout, pickupColumnTags?): void

Loads previously saved view layout. Only applicable to certain views, such as TableView. See also saveLayout

Parameters

ParameterType
layoutViewLayout
pickupColumnTags?boolean

Returns

void

Source

src/views/view.ts:297


loadStateMap()

loadStateMap(_stateMap): void

Loads view state map. Override in subclasses.

Parameters

ParameterType
_stateMapobject

Returns

void

Inherited from

ViewBase . loadStateMap

Source

src/views/view.ts:171


saveLayout()

saveLayout(): ViewLayout

Saves view layout as a string. Only applicable to certain views, such as TableView. See also loadLayout

Returns

ViewLayout

Source

src/views/view.ts:305


saveStateMap()

saveStateMap(): null | object

Returns

null | object

Viewer state map. Override in subclasses.

Inherited from

ViewBase . saveStateMap

Source

src/views/view.ts:168


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

Inherited from

ViewBase . setRibbonPanels

Source

src/views/view.ts:156


create()

static create(options?): View

Creates a new empty view.

Parameters

ParameterTypeDescription
options?null | string | object

Returns

View

Source

src/views/view.ts:249


createByType()

static createByType(viewType, options?): View

Creates one of the standard views based on the view type (such as 'functions')

Parameters

ParameterType
viewTypestring
options?any

Returns

View

Source

src/views/view.ts:257


forObject()

static forObject(x): null | View

Creates a view for the specified object, if it is registered, or null otherwise.

Parameters

ParameterType
xany

Returns

null | View

Source

src/views/view.ts:236


fromDart()

static fromDart(dart): View | TableView

Parameters

ParameterType
dartany

Returns

View | TableView

Source

src/views/view.ts:227


fromRoot()

static fromRoot(root): View

Parameters

ParameterType
rootHTMLElement

Returns

View

Source

src/views/view.ts:240


fromViewAsync()

static fromViewAsync(getViewAsync, ribbon): any

Parameters

ParameterTypeDefault value
getViewAsync() => Promise <View>undefined
ribbonbooleantrue

Returns

any

Source

src/views/view.ts:261