Class: Dialog

ol.control. Dialog

Application dialog


new Dialog(options)

Parameters:
Name Type Description
options *
Properties
Name Type Description
className string
map ol.Map

the map to place the dialog inside

target Element

target to place the dialog

fullscreen boolean

view dialog fullscreen (same as options.target = document.body)

zoom boolean

add a zoom effect

closeBox boolean

add a close button

max number

if not null add a progress bar to the dialog, default null

hideOnClick boolean

close dialog when click

hideOnBack boolean

close dialog when click the background

closeOnSubmit boolean

Prevent closing the dialog on submit

Fires:
  • event:show
  • event:hide
  • event:cancel
  • event:button

Extends

Methods


close()

Close the dialog


getContentElement()

Get dialog content element

Returns:
Type
Element

getInputs()

Get inputs, textarea an select of the dialog by classname

Returns:

a {key:value} list of Elements by classname

Type
Object

hide()

Close the dialog


isOpen()

The dialog is shown

Returns:

true if a dialog is open

Type
bool

open()

Open the dialog


setContent(options)

Set the dialog content

Parameters:
Name Type Description
options *
Properties
Name Type Argument Description
content Element | String

dialog content

title string

title of the dialog

className string

dialog class name

max number

if not null add a progress bar to the dialog

progress number

set the progress bar value

buttons Object

a key/value list of button to show

onButton function <optional>

a function that takes the button id and a list of input by className


setContentMessage(content)

Set the dialog content

Parameters:
Name Type Description
content Element | String

dialog content


setProgress(val, max, message)

Set progress

Parameters:
Name Type Description
val number | boolean

the progress value or false to hide the progressBar

max number
message string | element

setTitle(content)

Set the dialog title

Parameters:
Name Type Description
content Element | String

dialog content


show(options)

Show a new dialog

Parameters:
Name Type Description
options * | Element | string

options or a content to show

Properties
Name Type Argument Description
content Element | String

dialog content

title string

title of the dialog

className string

dialog class name

autoclose number

a delay in ms before auto close

hideOnBack boolean

close dialog when click the background

max number

if not null add a progress bar to the dialog

progress number

set the progress bar value

buttons Object

a key/value list of button to show

onButton function <optional>

a function that takes the button id and a list of input by className