Class: ManualColumnMove

ManualColumnMove

This plugin allows to change columns order. To make columns order persistent the Options#persistentState
plugin should be enabled.

API:

  • moveColumn - move single column to the new position.
  • moveColumns - move many columns (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 columns.
  • 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 returns true than the ManualColumnMove#enablePlugin method is called.

Returns: {Boolean}

moveColumn(column, target)

Moves a single column.

Parameters:
Name Type Description
column Number

Visual column index to be moved.

target Number

Visual column index being a target for the moved column.

Fires:

moveColumns(columns, target)

Moves a multiple columns.

Parameters:
Name Type Description
columns Array

Array of visual column indexes to be moved.

target Number

Visual column index being a target for the moved columns.

Fires:

persistentStateLoad()

Loads the manual column positions from the persistent state (the Options#persistentState option has to be enabled).

persistentStateSave()

Saves the manual column positions to the persistent state (the Options#persistentState option has to be enabled).

updatePlugin()

Updates the plugin state. This method is executed when Core#updateSettings is invoked.