Skip to content

Notification

Options

notification

Source code

notification.notification : boolean | object

The notification option configures the Notification plugin.

You can set the notification option to one of the following:

SettingDescription
falseDisable the Notification plugin
trueEnable the plugin with default options
An objectEnable the plugin and set stackLimit and animation
notification: Additional options
OptionTypeDefaultDescription
stackLimitnumber10Maximum visible toasts per corner. Extra requests are queued.
animationbooleantrueFade and slide animation when toasts appear.

Read more:

This option can only be set at the grid level. It has no effect when set in the columns, cells, or cell options.

Default: false
Since: 17.1.0
Example

notification: true,

Members

DEFAULT_SETTINGS

Source code

Notification.DEFAULT_SETTINGS

Returns the default settings applied when the plugin is enabled without explicit configuration.

PLUGIN_KEY

Source code

Notification.PLUGIN_KEY

Returns the plugin key used to identify this plugin in Handsontable settings.

PLUGIN_PRIORITY

Source code

Notification.PLUGIN_PRIORITY

Returns the priority order used to determine the order in which plugins are initialized.

SETTINGS_VALIDATORS

Source code

Notification.SETTINGS_VALIDATORS

Returns an object of validator functions used to type-check each settings property at runtime.

Methods

destroy

Source code

notification.destroy()

Clears queues and toast state, unregisters shortcuts and focus scope, and removes the host from the DOM.

disablePlugin

Source code

notification.disablePlugin()

Hides all toasts, removes shortcuts and listeners, and destroys the UI host.

hideAll() must run before super.disablePlugin() because BasePlugin.disablePlugin() clears this.enabled first, and hideAll() relies on the plugin still being enabled. The superclass call then removes hooks and clears the shared EventManager.

enablePlugin

Source code

notification.enablePlugin()

Installs the notification host, document focusin listener (tab order + prior-focus for click paths), shortcuts (F6 via grid + global shortcut contexts, Escape, Tab, Shift+Tab), and the focus scope.

getQueueSize

Source code

notification.getQueueSize() ⇒ number

Returns how many toasts are waiting in per-position queues.

hide

Source code

notification.hide(id)

Hides a toast by id.

ParamTypeDescription
idstringToast id returned from Notification#showMessage.

hideAll

Source code

notification.hideAll()

Hides every visible toast and clears all per-position queues.

isEnabled

Source code

notification.isEnabled() ⇒ boolean

Returns whether the notification setting is enabled for this instance.

isVisible

Source code

notification.isVisible([id]) ⇒ boolean

Returns whether a toast is visible, or whether any toast is visible when id is omitted.

ParamTypeDescription
[id]stringoptional Toast id.

showMessage

Source code

notification.showMessage(options) ⇒ string

Displays a toast. Returns the toast id, or an empty string when the toast is not shown.

Throws:

  • Error When options is invalid or actions are malformed.
ParamTypeDescription
optionsobjectToast options.
[options.variant]'info'
'success'
'warning'
'error'
optional Visual variant.
[options.title]stringoptional Optional title.
options.messagestring
HTMLElement
Main message body.
[options.duration]numberoptional Auto-dismiss delay in ms. 0 keeps the toast until dismissed manually.
[options.position]'top-start'
'top-end'
'bottom-start'
'bottom-end'
optional Corner stack.
[options.closable]booleanoptional Whether the close control is shown.
[options.actions]Array<NotificationActionSpec>optional Action buttons.

updatePlugin

Source code

notification.updatePlugin([newSettings])

Rebuilds the plugin after settings change when notification options actually change.

ParamTypeDescription
[newSettings]objectoptional Settings object passed to updateSettings (partial).