DragToScroll
Members
boundaries
dragToScroll.boundaries : DOMRect
Size of an element and its position relative to the viewport, e.g. {bottom: 449, height: 441, left: 8, right: 814, top: 8, width: 806, x: 8, y:8}.
DEFAULT_SETTINGS
DragToScroll.DEFAULT_SETTINGS
Returns the default settings applied when the plugin is enabled without explicit configuration.
PLUGIN_KEY
DragToScroll.PLUGIN_KEY
Returns the plugin key used to identify this plugin in Handsontable settings.
PLUGIN_PRIORITY
DragToScroll.PLUGIN_PRIORITY
Returns the priority order used to determine the order in which plugins are initialized.
Methods
check
dragToScroll.check(x, y)
Checks if the mouse position (X, Y) is outside the viewport and fires a callback with calculated X an Y diffs between passed boundaries.
| Param | Type | Description |
|---|---|---|
| x | number | Mouse X coordinate to check. |
| y | number | Mouse Y coordinate to check. |
destroy
dragToScroll.destroy()
Destroys the plugin instance.
disablePlugin
dragToScroll.disablePlugin()
Disables the plugin functionality for this Handsontable instance.
enablePlugin
dragToScroll.enablePlugin()
Enables the plugin functionality for this Handsontable instance.
isEnabled
dragToScroll.isEnabled() ⇒ boolean
Checks if the plugin is enabled in the handsontable settings. This method is executed in Hooks#beforeInit
hook and if it returns true then the DragToScroll#enablePlugin method is called.
setBoundaries
dragToScroll.setBoundaries([boundaries])
Sets the boundaries/dimensions of the scrollable viewport.
| Param | Type | Description |
|---|---|---|
| [boundaries] | DOMRect Object | optional An object with coordinates. Contains the window boundaries by default. The object is compatible with DOMRect. |
setCallback
dragToScroll.setCallback(callback)
Changes callback function.
| Param | Type | Description |
|---|---|---|
| callback | function | The callback function. |
updatePlugin
dragToScroll.updatePlugin()
Updates the plugin’s state.
This method is executed when updateSettings() is invoked with any of the following configuration options: