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.
Thank you for contacting us. I checked the example, but it throws an error when I try to sort the data. It seems that it was missing function return statement, but the fact that it’s not returning to the original order is most likely caused byt the logic itself inside this function. Here’s your version without the error: https://jsfiddle.net/handsoncode/evjgh6rL/
If it doesn’t work with your custom function there must be some issue within the logic of this function so I would recommend to check if there aren’t any conflicts there.
Could you please check this demo where formula columns are causing sorting issues? Additionally, script errors from the Handsontable libraries occurred during sorting of the formula columns.
I checked the example and while minifying it I discovered that the source of the issue the formula you use in the last column starting from the second row:
However, there’s another issue, and that’s an internal bug caused by the fact that after performing sorting operation our plugin change the ranges but the HyperFormula isn’t properly informed about those changes. I will add your case to the issue and will update you once we have the fix ready.
Not yet, it’s more complicated issue, and it has to be determined how to handle this behavior. It’s added to our backlog and I will let you know as soon as I have any updates.
This issue hasn’t been added to our roadmap yet. We will update this topic as soon as we have more information about the possible timeline for the fix.