This plugin allows to change rows order. To make rows order persistent the Options#persistentState
plugin should be enabled.
API:
- moveRow - move single row to the new position.
- moveRows - move many rows (as an array of indexes) to the new position.
If you want apply visual changes, you have to call manually the render() method on the instance of handsontable.
The plugin creates additional components to make moving possibly using user interface:
- backlight - highlight of selected rows.
- guideline - line which shows where rows has been moved.
Methods
-
destroy()
-
Destroys the plugin instance.
-
disablePlugin()
-
Disables the plugin functionality for this Handsontable instance.
-
enablePlugin()
-
Enables the plugin functionality for this Handsontable instance.
-
isEnabled(){Boolean}
-
Checks if the plugin is enabled in the handsontable settings. This method is executed in
Hooks#beforeInit
hook and if it returnstrue
than theManualRowMove#enablePlugin
method is called.Returns: {Boolean}
-
moveRow(row, target)
-
Moves a single row.
Parameters:
Name Type Description row
Number Visual row index to be moved.
target
Number Visual row index being a target for the moved row.
Fires:
-
moveRows(rows, target)
-
Moves a multiple rows.
Parameters:
Name Type Description rows
Array Array of visual row indexes to be moved.
target
Number Visual row index being a target for the moved rows.
Fires:
-
persistentStateLoad(){Array}
-
Loads the manual row positions from the persistent state (the
Options#persistentState
option has to be enabled).Fires:
- Hooks#event:persistentStateLoad
- Hooks#event:manualRowMove
Returns: {Array} Stored state.
-
persistentStateSave()
-
Saves the manual row positions to the persistent state (the
Options#persistentState
option has to be enabled).Fires:
- Hooks#event:persistentStateSave
- Hooks#event:manualRowMove
-
updatePlugin()
-
Updates the plugin state. This method is executed when
Core#updateSettings
is invoked.