Dialog
A non-modal dialog. Sample: https://public.datagrok.ai/js/samples/ui/dialogs
Example
ui.dialog('Windows')
.add(ui.)
.add(ui.span(['People of Earth, your attention, please… ']))
.onOK(() => { grok.shell.info('OK!'); })
.show();
Extends
Extended by
Constructors
new Dialog()
new Dialog(
dart
):Dialog
Parameters
Parameter | Type |
---|---|
dart | any |
Returns
Overrides
Source
Properties
Property | Modifier | Type | Default value | Description | Inherited from |
---|---|---|---|---|---|
_properties | protected | Property [] | undefined | - | DartWidget ._properties |
_root | protected | HTMLElement | undefined | - | DartWidget ._root |
dart | public | any | undefined | - | DartWidget .dart |
factory | public | null | Func | null | Constructor function. No parameters, returns [Widget]. | DartWidget .factory |
isDetached | public | boolean | false | - | DartWidget .isDetached |
props | public | any | undefined | - | DartWidget .props |
subs | public | Subscription [] | undefined | - | DartWidget .subs |
temp | public | any | undefined | Contains auxiliary information | DartWidget .temp |
Accessors
helpUrl
get
helpUrl():string
When provided, adds a "?" icon to the dialog header on the right.
set
helpUrl(url
):void
Parameters
Parameter | Type |
---|---|
url | string |
Returns
string
Source
inputs
get
inputs():InputBase
<any
>[]
Returns a list of the dialog's inputs.
Returns
InputBase
<any
>[]
Source
onClose
get
onClose():Observable
<any
>
Returns
Observable
<any
>
Source
root
get
root():HTMLElement
Widget's visual root.
Returns
HTMLElement
Source
title
get
title():string
Returns the title of a dialog.
set
title(t
):void
Parameters
Parameter | Type |
---|---|
t | string |
Returns
string
Source
type
get
type():string
Returns
string
Source
Methods
add()
add(
content
):Dialog
Adds content to the dialog.
Parameters
Parameter | Type | Description |
---|---|---|
content | HTMLElement | Widget <any > | InputBase <any > |
Returns
Source
addButton()
addButton(
text
,action
,index
,tooltip
):Dialog
Adds command button with the specified text.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
text | string | undefined | |
action | Function | undefined | |
index | number | 0 | |
tooltip | any | null |
Returns
Source
addContextAction()
addContextAction(
text
,action
):Dialog
Adds context action with the specified text.
Parameters
Parameter | Type | Description |
---|---|---|
text | string | |
action | Function |
Returns
Source
addProperty()
private
addProperty(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" | "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 & PropertyOptions | 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
apply()
apply(
properties
):Widget
<any
>
Parameters
Parameter | Type | Description |
---|---|---|
properties | object |
Returns
Widget
<any
>
Inherited from
Source
awaitOnOK()
awaitOnOK<
T
>(handler
):Promise
<T
>
Sets the OK button handler and returns a promise of the handler callback.
Type parameters
Type parameter | Value |
---|---|
T | any |
Parameters
Parameter | Type | Description |
---|---|---|
handler | () => Promise <T > |
Returns
Promise
<T
>
Source
clear()
clear():
void
Clears the content.
Returns
void
Source
close()
close():
void
Closes the dialog.
Returns
void
Source
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
Inherited from
Source
getButton()
getButton(
text
):HTMLButtonElement
Returns command button with the specified text.
Parameters
Parameter | Type | Description |
---|---|---|
text | string |
Returns
HTMLButtonElement
Source
getDartProperties()
getDartProperties():
any
[]
Returns
any
[]
Inherited from
DartWidget
. getDartProperties
Source
getProperties()
getProperties():
Property
[]
Returns
Property
[]
Inherited from
Source
history()
history(
getInput
,applyInput
):void
Initializes the 'history' feature.
Parameters
Parameter | Type | Description |
---|---|---|
getInput | () => any | collects the input from UI into JSON-serializable object |
applyInput | (x ) => void | refreshes the UI according to input |
Returns
void
Source
initDefaultHistory()
initDefaultHistory():
Dialog
Initializes default history.
Returns
Source
input()
input(
caption
):InputBase
<any
>
Returns an input with the specified caption, or throws an exception.
Parameters
Parameter | Type |
---|---|
caption | string |
Returns
InputBase
<any
>
Source
onCancel()
onCancel(
handler
):Dialog
Sets the CANCEL button handler
Parameters
Parameter | Type | Description |
---|---|---|
handler | Function |
Returns
Source
onFrameAttached()
onFrameAttached(
dataFrame
):void
Parameters
Parameter | Type |
---|---|
dataFrame | DataFrame |
Returns
void
Inherited from
Source
onOK()
onOK(
handler
):Dialog
Sets the OK button handler, and shows the OK button
Parameters
Parameter | Type | Description |
---|---|---|
handler | Function |
Returns
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
DartWidget
. onPropertyChanged
Source
show()
show(
options
?):Dialog
Parameters
Parameter | Type | Description |
---|---|---|
options ? | object | |
options.backgroundColor ? | string | - |
options.center ? | boolean | - |
options.centerAt ? | Element | - |
options.fullScreen ? | boolean | - |
options.height ? | number | - |
options.modal ? | boolean | - |
options.resizable ? | boolean | - |
options.showNextTo ? | HTMLElement | - |
options.width ? | number | - |
options.x ? | number | - |
options.y ? | number | - |
Returns
Source
showModal()
showModal(
fullScreen
):Dialog
Parameters
Parameter | Type | Description |
---|---|---|
fullScreen | boolean |
Returns
Source
sourceRowsChanged()
sourceRowsChanged():
void
Returns
void
Inherited from
DartWidget
. sourceRowsChanged
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
create()
static
create(options
?):Dialog
Creates a new dialog with the specified options.
Parameters
Parameter | Type |
---|---|
options ? | string | object |
Returns
Source
find()
static
find(root
):null
|Widget
<any
>
Finds existing widget from its visual root.
Parameters
Parameter | Type |
---|---|
root | Element |
Returns
null
| Widget
<any
>
Inherited from
Source
fromRoot()
static
fromRoot(root
):Widget
<any
>
Creates a new widget from the root element.
Parameters
Parameter | Type |
---|---|
root | HTMLElement |
Returns
Widget
<any
>
Inherited from
Source
getAll()
static
getAll():Widget
<any
>[]
Returns all currently active widgets.
Returns
Widget
<any
>[]
Inherited from
Source
getOpenDialogs()
static
getOpenDialogs():Dialog
[]
Returns currently open dialogs.
Returns
Dialog
[]