Breaking changes:
- Rewritten the
PersistentState
plugin to ES6. (#4618) From this version onward you can access the plugin like all regular plugins (hot.getPlugin('persistentState')
), not from the main instance (thehot.storage
object is now accesible fromhot.getPlugin('persistentState').storage
) - Added support for selecting non-contiguous cells or ranges (#4708). That required some changes - some of them are backward incompatible:
New API
hot.getSelectedLast()
Returns an array with coordinates of the last selected layer ([row, col, rowEnd, colEnd]
). This method behaves ashot.getSelected()
before the breaking change.hot.getSelectedRangeLast()
Returns aCellRange
object containing the last selection coordinates applied to the table. This method behaves ashot.getSelectedRange()
before the braking change.hot.alter('remove_row', [[1, 4], [10, 1]])
Supports removing non-contiguous rows. Instead of passing the row index, we can pass an array of arrays, where the first item is the index of the row and at the second item is the amount of rows to be removed;hot.alter('remove_col', [[1, 4], [10, 1]])
Same as above, but for the columns. Only "remove" actions support that new feature.
Breaking Changes:
hot.getSelected()
Returns an array of arrays with the coordinates of all layers ([[row, col, rowEnd, colEnd], [row, col, rowEnd, colEnd] ...]
);hot.getSelectedRange()
Returns an array ofCellRange
objects with the coordinates of all layers ([{CellRange}, {CellRange} ...]
);- Previously
hot.selection.empty()
, nowhot.emptySelectedCells()
; - Changed selection colors:
- area borders, was
#89aff9
-> is#4b89ff
- area background, was
#b5d1ff
-> is#005eff
- current selection border, was
#5292f7
-> is#4b89ff
- area borders, was
- Removed the
multiSelect
setting and replaced it withselectionMode: 'single'
; - Added a new
selectionMode
option, which can be set either as'single'
(previously asmultiSelect: false
),'range'
(previously asmultiSelect: true
) or'multiple'
(new non-contiguous mode);
Compatible Changes:
afterSelection
- previously:
afterSelection(row, column, rowEnd, columnEnd, preventScrolling)
- now:
afterSelection(row, column, rowEnd, columnEnd, preventScrolling, selectionLayerLevel)
- previously:
afterSelectionByProp
- previously:
afterSelectionByProp(row, prop, rowEnd, propEnd, preventScrolling)
- now:
afterSelectionByProp(row, prop, rowEnd, propEnd, preventScrolling, selectionLayerLevel)
- previously:
afterSelectionEnd
- previously:
afterSelectionEnd(row, column, rowEnd, columnEnd)
- now:
afterSelectionEnd(row, column, rowEnd, columnEnd, selectionLayerLevel)
- previously:
afterSelectionEndByProp
- previously:
afterSelectionEndByProp(row, prop, rowEnd, propEnd)
- now:
afterSelectionEndByProp(row, prop, rowEnd, propEnd, selectionLayerLevel)
- previously:
We've added a selectionLayerLevel
argument for all the hooks listed above. The selectionLayerLevel
is a number indicating which selection layer is currently being modified. For the first selection, this value is 0
, with the new added layers this number increases.
Changes:
- Added an option to prevent row creation using the
beforeCreateRow
hook. (#4749) - Fixed a bug, where freezing and unfreezing the last column crashed the browser. (#4642)
- Added tests for the translation feature. (#4723)
The corresponding Handsontable Pro version is 1.16.0.