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 returnstruethan theManualRowMove#enablePluginmethod is called.Returns: {Boolean}
-
moveRow(row, target)
-
Moves a single row.
Parameters:
Name Type Description rowNumber Visual row index to be moved.
targetNumber Visual row index being a target for the moved row.
Fires:
-
moveRows(rows, target)
-
Moves a multiple rows.
Parameters:
Name Type Description rowsArray Array of visual row indexes to be moved.
targetNumber Visual row index being a target for the moved rows.
Fires:
-
persistentStateLoad(){Array}
-
Loads the manual row positions from the persistent state (the
Options#persistentStateoption 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#persistentStateoption has to be enabled).Fires:
- Hooks#event:persistentStateSave
- Hooks#event:manualRowMove
-
updatePlugin()
-
Updates the plugin state. This method is executed when
Core#updateSettingsis invoked.