Skip to content

Methods

destroy

Source code

dialog.destroy()

Destroy dialog and reset plugin state.

disablePlugin

Source code

dialog.disablePlugin()

Disable plugin for this Handsontable instance.

enablePlugin

Source code

dialog.enablePlugin()

Enable plugin for this Handsontable instance.

focus

Source code

dialog.focus()

Focus the dialog.

hide

Source code

dialog.hide()

Hide the currently open dialog. Closes the dialog and restores the focus to the table.

isEnabled

Source code

dialog.isEnabled() ⇒ boolean

Check if the plugin is enabled in the handsontable settings.

isVisible

Source code

dialog.isVisible() ⇒ boolean

Check if the dialog is currently visible.

Returns: boolean - True if the dialog is visible, false otherwise.

show

Source code

dialog.show(options)

Show dialog with given configuration. Displays the dialog with the specified content and options.

ParamTypeDescription
optionsobjectDialog configuration object containing content and display options.
options.templateobjectThe template to use for the dialog (default: null). The error will be thrown when the template is provided together with the content option.
options.template.type'confirm'The type of the template (‘confirm’).
options.template.titlestringThe title of the dialog.
options.template.descriptionstringThe description of the dialog. Default: ”.
options.template.buttonsArray<object>The buttons to display in the dialog. Default: [].
options.template.buttons.textstringThe text of the button.
options.template.buttons.type'primary'
'secondary'
The type of the button.
options.template.buttons.callbackfunctionThe callback to trigger when the button is clicked.
options.contentstring
HTMLElement
DocumentFragment
The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ”
options.customClassNamestringCustom CSS class name to apply to the dialog container. Default: ”
options.background'solid'
'semi-transparent'
Dialog background variant. Default: ‘solid’.
options.contentBackgroundbooleanWhether to show content background. Default: false.
options.animationbooleanWhether to enable animations when showing/hiding the dialog. Default: true.
options.closablebooleanWhether the dialog can be closed by user interaction. Default: false.
options.a11yobjectObject with accessibility options.
options.a11y.rolestringThe role of the dialog. Default: ‘dialog’.
options.a11y.ariaLabelstringThe label of the dialog. Default: ‘Dialog’.
options.a11y.ariaLabelledbystringThe ID of the element that labels the dialog. Default: ”.
options.a11y.ariaDescribedbystringThe ID of the element that describes the dialog. Default: ”.

showAlert

Source code

dialog.showAlert(message, [callback])

Displays the alert dialog with the specified content.

ParamTypeDescription
messagestring
Object
The message to display in the dialog. Can be a string or an object with title and description properties.
[callback]functionoptional The callback to trigger when the button is clicked.

showConfirm

Source code

dialog.showConfirm(message, [onOk], [onCancel])

Displays the confirm dialog with the specified content and options.

ParamTypeDescription
messagestring
Object
The message to display in the dialog. Can be a string or an object with title and description properties.
[onOk]functionoptional The callback to trigger when the OK button is clicked.
[onCancel]functionoptional The callback to trigger when the Cancel button is clicked.

update

Source code

dialog.update(options)

Update the dialog configuration.

ParamTypeDescription
optionsobjectDialog configuration object containing content and display options.
options.templateobjectThe template to use for the dialog (default: null). The error will be thrown when the template is provided together with the content option.
options.template.type'confirm'The type of the template (‘confirm’).
options.template.titlestringThe title of the dialog.
options.template.descriptionstringThe description of the dialog. Default: ”.
options.template.buttonsArray<object>The buttons to display in the dialog. Default: [].
options.template.buttons.textstringThe text of the button.
options.template.buttons.type'primary'
'secondary'
The type of the button.
options.template.buttons.callbackfunctionThe callback to trigger when the button is clicked.
options.contentstring
HTMLElement
DocumentFragment
The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ”
options.customClassNamestringCustom CSS class name to apply to the dialog container. Default: ”
options.background'solid'
'semi-transparent'
Dialog background variant. Default: ‘solid’.
options.contentBackgroundbooleanWhether to show content background. Default: false.
options.animationbooleanWhether to enable animations when showing/hiding the dialog. Default: true.
options.closablebooleanWhether the dialog can be closed by user interaction. Default: false.
options.a11yobjectObject with accessibility options.
options.a11y.rolestringThe role of the dialog. Default: ‘dialog’.
options.a11y.ariaLabelstringThe label of the dialog. Default: ‘Dialog’.
options.a11y.ariaLabelledbystringThe ID of the element that labels the dialog. Default: ”.
options.a11y.ariaDescribedbystringThe ID of the element that describes the dialog. Default: ”.

updatePlugin

Source code

dialog.updatePlugin()

Update plugin state after Handsontable settings update.