Implementing the compareFunctionFactory function has some issue, and there is no way to revert to the original data order after sorting in ascending and descending order using compareFunctionFactory. The ‘compareFunctionFactory’ is particularly concerning due to its inability to revert to the original data order and its failure to trigger after sorting orders. However, without using the compareFunctionFactory, the data return to its original order after sorting in both ascending and descending orders.
JsFiddle Demo
https://jsfiddle.net/rmotukuri2025/o8mpherv/1
HandsonTable on table settings
hot = new Handsontable(container, {
data: gridData,
startRows: 8,
startCols: 8,
headerTooltips: {
rows: false,
columns: true,
},
// sortIndicator: true,
multiColumnSorting: {
sortEmptyCells: false,
indicator: true,
headerAction: true,
compareFunctionFactory: compareFunctionFactory,
//sortColumnIndexes: getSortableColumnsIndexes([‘Name’, ‘Code’])
}
}