This page shows how to move rows and columns in Handsontable.
To enable move features, use settings
manualColumnMove: true and
A draggable move handle appears above the selected column/row header. You can click and drag it to any location in the column header body.
Drag and move actions of
There are significant differences between the plugin's
moveRows API functions. Both of them change the order of rows,
but what is important, they rely on other kind of indexes. The differences between them are shown in the diagrams below. Please keep in mind that both of these methods trigger the
dragRows passes the
dropIndex argument to them.
dragRows method with the
dropIndex parameter. This argument points to where we are going to drop the moved elements.
moveRows method with the
The argument points to where the elements will be placed after the moving action (
finalIndex being the index of the first moved element).
Some of actions to be performed by
moveRows function aren't possible, i.e. we can't move more than one element to the last position. In this case, the move will be cancelled.
isMovePossible API method and the
movePossible parameter of
afterRowMove hooks may be helpful in determining such situations.