Loading
See the Loading guide for examples and configuration details.
Options
loading
Can be set at: grid
loading.loading : boolean | object
The loading option configures the Loading plugin.
The Loading plugin depends on the Dialog plugin and turns it
on while loading is enabled, so you don’t need to set dialog: true. The dialog
option itself keeps its value. When you turn loading off, the Dialog plugin turns off too, unless
the dialog option is set.
You can set the loading option to one of the following:
| Setting | Description |
|---|---|
false | Disable the Loading plugin |
true | Enable the Loading plugin with default configuration |
| An object | - Enable the Loading plugin- Apply custom configuration |
If you set the loading option to an object, you can configure the following loading options:
| Option | Possible settings | Description |
|---|---|---|
icon | A string | Custom loading icon to display (default: <svg />) |
title | A string | Custom loading title to display (default: 'Loading...') |
description | A string | Custom loading description to display (default: '') |
title and description render as text. Markup passed in them shows up literally rather
than being interpreted, so use icon for the one slot that takes markup.
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.
The loading indicator is available on the main grid only. In a grid nested in a cell, that is a
cell of the
handsontable,
autocomplete, or
dropdown cell type, this
option has no effect.
Default: false
Since: 16.1.0
Example
// enable the `Loading` plugin with default configurationloading: true,
// enable the `Loading` plugin with custom configurationloading: { icon: 'A custom loading icon in SVG format', title: 'Custom loading title', description: 'Custom loading description',}Members
DEFAULT_SETTINGS
Loading.DEFAULT_SETTINGS
Returns the default settings applied when the plugin is enabled without explicit configuration.
LICENSE
Loading.LICENSE
Returns the license token of the plugin, its display name, where it is checked, and the tokens it requires.
PLUGIN_DEPS
Loading.PLUGIN_DEPS
Returns the list of plugin dependencies required before this plugin can be initialized.
PLUGIN_KEY
Loading.PLUGIN_KEY
Returns the plugin key used to identify this plugin in Handsontable settings.
PLUGIN_PRIORITY
Loading.PLUGIN_PRIORITY
Returns the priority order used to determine the order in which plugins are initialized.
SETTINGS_VALIDATORS
Loading.SETTINGS_VALIDATORS
Returns an object of validator functions used to type-check each settings property at runtime.
Methods
destroy
loading.destroy()
Destroy plugin instance. The plugin stops requiring the Dialog plugin, so a plugin destroyed ahead of
the grid does not keep Dialog required; the next settings update turns Dialog off unless the dialog
option keeps it on. Dialog is not turned off here: during the grid’s own teardown its data source is
already gone, and a direct disable would hide the dialog against it.
disablePlugin
loading.disablePlugin()
Disable plugin for this Handsontable instance. The plugin stops requiring the Dialog plugin, and the
Dialog plugin turns off too unless the dialog option keeps it on.
enablePlugin
loading.enablePlugin()
Enable plugin for this Handsontable instance.
hide
loading.hide()
Hide loading dialog. A dialog the application shows with its own content stays on screen.
isEnabled
loading.isEnabled() ⇒ boolean
Check if the plugin is enabled in the handsontable settings.
The loading indicator renders through the Dialog plugin, which is available on the main
Handsontable instance only. In a nested grid (the one the handsontable, autocomplete, and
dropdown cell types create) there is nothing to render into, so the plugin stays disabled
there.
isVisible
loading.isVisible() ⇒ boolean
Check if loading dialog is currently visible. A dialog the application shows with its own content does not count.
show
loading.show(options)
Show loading dialog with optional custom options. A dialog the application shows at that moment is hidden first, and the loading screen takes its place.
| Param | Type | Description |
|---|---|---|
| options | object | Custom loading options. |
| options.icon | string | Custom loading icon. |
| options.title | string | Custom loading title. |
| options.description | string | Custom loading description. |
update
loading.update(options)
Update loading description without hiding/showing the dialog. The new options are kept for the next
show() when the loading screen is not on screen, and a dialog the application shows is left alone.
| Param | Type | Description |
|---|---|---|
| options | object | Custom loading options. |
| options.icon | string | Custom loading icon. |
| options.title | string | Custom loading title. |
| options.description | string | Custom loading description. |
updatePlugin
loading.updatePlugin()
Update plugin state after Handsontable settings update. The plugin stays enabled, so a loading
screen on screen stays there and shows the new options, and no beforeLoadingHide or
afterLoadingHide fires for it. Turning the option off goes through disablePlugin() instead,
which hides the screen.