npm handsontable 6.0.0

latest releases: 0.0.0-next-08b4877-20241030, 0.0.0-next-3f2ad1e-20241030, 0.0.0-next-4c8e3b1-20241029...
6 years ago

This release contains changes to the ColumnSorting plugin exclusively. Detailed information about the changes can be found in the description of pull request #5411 and in our documentation.

Breaking Changes

  • We refactored and rewrote parts of the ColumnSorting plugin in order for it to work seamlessly with the new MultiColumnSorting plugin for Handsontable Pro. This allowed us to fix multiple problems that the previous version of the plugin had.
    This introduced some backward-incompatible changes:
    • The configuration items (such as sortIndicator, sortEmptyCells, sortFunction) for the plugin were moved into the scope of the plugin config.
    • The initial plugin configuration is stored under the initialConfig property in the plugin configuration.
    • The sortFunction config item was renamed to compareFunctionFactory and converted to a factory returning a compare function (and moved into the plugin configuration scope, as mentioned above).
    • The sortIndicator config item was renamed to indicator (and moved into the plugin configuration scope, as mentioned above).
    • Comparator function structure changed:
     // Was:
     function numericSort(sortOrder, columnMeta) {
     	return function ([, value], [, nextValue]) {
    
     // Is:
     function numericSort(sortOrder, columnMeta) {
     	return function (value, nextValue) {
    
    • The sort method arguments were reorganized, so it accepts the sorting configuration as an object:
     hot.getPlugin('columnSorting').sort({ column: 0, sortOrder: 'asc' });
    
    • Some public methods were rewritten, renamed and set as private, namely:
      • getNextOrderState
      • loadSortingState
      • saveSortingState
    • The beforeColumnSort and afterColumnSort hooks receive a different set of arguments. For more information, check our documentation.
    • Calling the updateSettings method with columnSorting defined will set a fresh sort configuration.

Changes

Apart from the breaking changes above, this release introduces some additional changes to the sorting plugin:

  • Replaced the current sorting indicators with new ones, in the form of arrows.
  • The sorting indicators will be displayed by default.
  • Added a possibility to disable the action of sorting by clicking on the headers, using the headerAction option.

Don't miss a new handsontable release

NewReleases is sending notifications on new releases.