Dialog
Methods
destroy
dialog.destroy()
Destroy dialog and reset plugin state.
disablePlugin
dialog.disablePlugin()
Disable plugin for this Handsontable instance.
enablePlugin
dialog.enablePlugin()
Enable plugin for this Handsontable instance.
focus
dialog.focus()
Focus the dialog.
hide
dialog.hide()
Hide the currently open dialog. Closes the dialog and restores the focus to the table.
isEnabled
dialog.isEnabled() ⇒ boolean
Check if the plugin is enabled in the handsontable settings.
isVisible
dialog.isVisible() ⇒ boolean
Check if the dialog is currently visible.
Returns: boolean - True if the dialog is visible, false otherwise.
show
dialog.show(options)
Show dialog with given configuration. Displays the dialog with the specified content and options.
| Param | Type | Description |
|---|---|---|
| options | object | Dialog configuration object containing content and display options. |
| options.template | object | The 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.title | string | The title of the dialog. |
| options.template.description | string | The description of the dialog. Default: ”. |
| options.template.buttons | Array<object> | The buttons to display in the dialog. Default: []. |
| options.template.buttons.text | string | The text of the button. |
| options.template.buttons.type | 'primary' 'secondary' | The type of the button. |
| options.template.buttons.callback | function | The callback to trigger when the button is clicked. |
| options.content | string HTMLElement DocumentFragment | The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ” |
| options.customClassName | string | Custom CSS class name to apply to the dialog container. Default: ” |
| options.background | 'solid' 'semi-transparent' | Dialog background variant. Default: ‘solid’. |
| options.contentBackground | boolean | Whether to show content background. Default: false. |
| options.animation | boolean | Whether to enable animations when showing/hiding the dialog. Default: true. |
| options.closable | boolean | Whether the dialog can be closed by user interaction. Default: false. |
| options.a11y | object | Object with accessibility options. |
| options.a11y.role | string | The role of the dialog. Default: ‘dialog’. |
| options.a11y.ariaLabel | string | The label of the dialog. Default: ‘Dialog’. |
| options.a11y.ariaLabelledby | string | The ID of the element that labels the dialog. Default: ”. |
| options.a11y.ariaDescribedby | string | The ID of the element that describes the dialog. Default: ”. |
showAlert
dialog.showAlert(message, [callback])
Displays the alert dialog with the specified content.
| Param | Type | Description |
|---|---|---|
| message | string Object | The message to display in the dialog. Can be a string or an object with title and description properties. |
| [callback] | function | optional The callback to trigger when the button is clicked. |
showConfirm
dialog.showConfirm(message, [onOk], [onCancel])
Displays the confirm dialog with the specified content and options.
| Param | Type | Description |
|---|---|---|
| message | string Object | The message to display in the dialog. Can be a string or an object with title and description properties. |
| [onOk] | function | optional The callback to trigger when the OK button is clicked. |
| [onCancel] | function | optional The callback to trigger when the Cancel button is clicked. |
update
dialog.update(options)
Update the dialog configuration.
| Param | Type | Description |
|---|---|---|
| options | object | Dialog configuration object containing content and display options. |
| options.template | object | The 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.title | string | The title of the dialog. |
| options.template.description | string | The description of the dialog. Default: ”. |
| options.template.buttons | Array<object> | The buttons to display in the dialog. Default: []. |
| options.template.buttons.text | string | The text of the button. |
| options.template.buttons.type | 'primary' 'secondary' | The type of the button. |
| options.template.buttons.callback | function | The callback to trigger when the button is clicked. |
| options.content | string HTMLElement DocumentFragment | The content to display in the dialog. Can be a string, HTMLElement, or DocumentFragment. Default: ” |
| options.customClassName | string | Custom CSS class name to apply to the dialog container. Default: ” |
| options.background | 'solid' 'semi-transparent' | Dialog background variant. Default: ‘solid’. |
| options.contentBackground | boolean | Whether to show content background. Default: false. |
| options.animation | boolean | Whether to enable animations when showing/hiding the dialog. Default: true. |
| options.closable | boolean | Whether the dialog can be closed by user interaction. Default: false. |
| options.a11y | object | Object with accessibility options. |
| options.a11y.role | string | The role of the dialog. Default: ‘dialog’. |
| options.a11y.ariaLabel | string | The label of the dialog. Default: ‘Dialog’. |
| options.a11y.ariaLabelledby | string | The ID of the element that labels the dialog. Default: ”. |
| options.a11y.ariaDescribedby | string | The ID of the element that describes the dialog. Default: ”. |
updatePlugin
dialog.updatePlugin()
Update plugin state after Handsontable settings update.