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
Parameter | Type |
---|---|
dart | any |
Returns
Overrides
Constructs
View
Source
Properties
Property | Modifier | Type | Default value | Description | Inherited from |
---|---|---|---|---|---|
_name | protected | string | 'New View' | - | ViewBase ._name |
_root | protected | HTMLElement | undefined | - | ViewBase ._root |
dart | public | any | undefined | - | ViewBase .dart |
subs | public | Subscription [] | undefined | - | ViewBase .subs |
temp | public | any | undefined | Contains auxiliary information | - |
ALL_VIEW_TYPES | readonly | string [] | ... | - | - |
APPS | readonly | "apps" | 'apps' | - | - |
BROWSE | readonly | "browse" | 'browse' | - | - |
DATABASES | readonly | "databases" | 'databases' | - | - |
DATA_CONNECTIONS | readonly | "connections" | 'connections' | - | - |
DATA_JOB_RUNS | readonly | "jobs" | 'jobs' | - | - |
DATA_QUERY_RUNS | readonly | "queryruns" | 'queryruns' | - | - |
EMAILS | readonly | "emails" | 'emails' | - | - |
FILES | readonly | "files" | 'files' | - | - |
FORUM | readonly | "forum" | 'forum' | - | - |
FUNCTIONS | readonly | "functions" | 'functions' | - | - |
GROUPS | readonly | "groups" | 'groups' | - | - |
HELP | readonly | "help" | 'help' | - | - |
JS_EDITOR | readonly | "js" | 'js' | - | - |
MODELS | readonly | "models" | 'models' | - | - |
NOTEBOOKS | readonly | "notebooks" | 'notebooks' | - | - |
OPEN_TEXT | readonly | "text" | 'text' | - | - |
PACKAGES | readonly | "packages" | 'packages' | - | - |
PACKAGE_REPOSITORIES | readonly | "repositories" | 'repositories' | - | - |
PROJECTS | readonly | "projects" | 'projects' | - | - |
QUERIES | readonly | "queries" | 'queries' | - | - |
SCRIPT | readonly | "script" | 'script' | - | - |
SCRIPTS | readonly | "scripts" | 'scripts' | - | - |
SETTINGS | readonly | "settings" | 'settings' | - | - |
SKETCH | readonly | "sketch" | 'sketch' | - | - |
USERS | readonly | "users" | 'users' | - | - |
VIEW_LAYOUTS | readonly | "layouts" | 'layouts' | - | - |
WEB_SERVICES | readonly | "webservices" | 'webservices' | - | - |
WELCOME | readonly | "welcome" | 'welcome' | - | - |
Accessors
basePath
get
basePath():string
Deprecated
use path instead
set
basePath(s
):void
Parameters
Parameter | Type |
---|---|
s | string |
Returns
string
Source
box
get
box():boolean
set
box(b
):void
Parameters
Parameter | Type |
---|---|
b | boolean |
Returns
boolean
Source
closing
get
closing():boolean
Whether the view is currently closing.
set
closing(c
):void
Parameters
Parameter | Type |
---|---|
c | boolean |
Returns
boolean
Source
description
get
description():string
set
description(s
):void
Parameters
Parameter | Type |
---|---|
s | string |
Returns
string
Source
entity
get
entity():null
|object
set
entity(_e
):void
Parameters
Parameter | Type |
---|---|
_e | null | object |
Returns
null
| object
Source
helpUrl
get
helpUrl():null
|string
set
helpUrl(url
):void
Parameters
Parameter | Type |
---|---|
url | null | string |
Returns
null
| string
View help URL.
Source
id
get
id():string
Returns
string
Source
name
get
name():string
View name. It gets shown in the tab handle.
set
name(s
):void
Parameters
Parameter | Type |
---|---|
s | string |
Returns
string
Source
parentCall
get
parentCall():undefined
|FuncCall
set
parentCall(s
):void
Parameters
Parameter | Type |
---|---|
s | undefined | FuncCall |
Returns
undefined
| FuncCall
Source
parentView
get
parentView():ViewBase
set
parentView(s
):void
Parameters
Parameter | Type |
---|---|
s | ViewBase |
Returns
Source
path
get
path():string
View URI, relative to the view root
set
path(s
):void
Parameters
Parameter | Type |
---|---|
s | string |
Returns
string
Source
ribbonMenu
get
ribbonMenu():Menu
View menu. Sample: https://public.datagrok.ai/js/samples/ui/views/ribbon
set
ribbonMenu(menu
):void
Parameters
Parameter | Type |
---|---|
menu | Menu |
Returns
Source
root
get
root():HTMLElement
Returns
HTMLElement
Source
statusBarPanels
get
statusBarPanels():HTMLDivElement
[]
Status bar panels to be shown on the bottom
set
statusBarPanels(panels
):void
Parameters
Parameter | Type |
---|---|
panels | HTMLDivElement [] |
Returns
HTMLDivElement
[]
Source
toolbox
get
toolbox():HTMLElement
View toolbox. Sample: https://public.datagrok.ai/js/samples/ui/views/toolbox
set
toolbox(x
):void
Parameters
Parameter | Type |
---|---|
x | HTMLElement |
Returns
HTMLElement
Source
type
get
type():string
View type
Returns
string
Source
Methods
_onAdded()
_onAdded():
void
Returns
void
Source
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.
Inherited from
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
Inherited from
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
Inherited from
Source
close()
close():
void
Closes this view.
Returns
void
Inherited from
Source
detach()
detach():
void
Detaches this view.
Returns
void
Inherited from
Source
getIcon()
getIcon():
null
|HTMLElement
Returns
null
| HTMLElement
View icon. Override in subclasses.
Inherited from
Source
getInfo()
getInfo():
ViewLayout
Saves view as a ViewInfo. Only applicable to certain views, such as TableView.
Returns
Source
getRibbonPanels()
getRibbonPanels():
HTMLElement
[][]
Returns
HTMLElement
[][]
Inherited from
Source
handlePath()
handlePath(
_urlPath
):void
Handles URL path. Override in subclasses.
Parameters
Parameter | Type |
---|---|
_urlPath | string |
Returns
void
Inherited from
Source
loadLayout()
loadLayout(
layout
,pickupColumnTags
?):void
Loads previously saved view layout. Only applicable to certain views, such as TableView. See also saveLayout
Parameters
Parameter | Type |
---|---|
layout | ViewLayout |
pickupColumnTags ? | boolean |
Returns
void
Source
loadStateMap()
loadStateMap(
_stateMap
):void
Loads view state map. Override in subclasses.
Parameters
Parameter | Type |
---|---|
_stateMap | object |
Returns
void
Inherited from
Source
saveLayout()
saveLayout():
ViewLayout
Saves view layout as a string. Only applicable to certain views, such as TableView. See also loadLayout
Returns
Source
saveStateMap()
saveStateMap():
null
|object
Returns
null
| object
Viewer state map. Override in subclasses.
Inherited from
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
Inherited from
Source
create()
static
create(options
?):View
Creates a new empty view.
Parameters
Parameter | Type | Description |
---|---|---|
options ? | null | string | object |
Returns
Source
createByType()
static
createByType(viewType
,options
?):View
Creates one of the standard views based on the view type (such as 'functions')
Parameters
Parameter | Type |
---|---|
viewType | string |
options ? | any |
Returns
Source
forObject()
static
forObject(x
):null
|View
Creates a view for the specified object, if it is registered, or null otherwise.
Parameters
Parameter | Type |
---|---|
x | any |
Returns
null
| View
Source
fromDart()
Parameters
Parameter | Type |
---|---|
dart | any |
Returns
Source
fromRoot()
static
fromRoot(root
):View
Parameters
Parameter | Type |
---|---|
root | HTMLElement |
Returns
Source
fromViewAsync()
static
fromViewAsync(getViewAsync
,ribbon
):any
Parameters
Parameter | Type | Default value |
---|---|---|
getViewAsync | () => Promise <View > | undefined |
ribbon | boolean | true |
Returns
any