Add custom sorting function

Tags: #<Tag:0x00007fd2c1234e98>

Greetings,

I want to add a custom sorting function that would sort by absolute values. Also, I do not want to disable the built-in sorting functions (by ascending and descending). Is it possible to do it via GridSettings?

Thank you!

P.S. Where are ascending and descending sort algorithms are stored? Is it somewhere in the core-js?
P.P.S. Found a demo with columnSortingFactory: https://jsfiddle.net/handsoncode/gf19kcwb/, is it relevant to the todays version?

Hi @n.schipkov

yes, the compare function is still in use in the latest version. Here’s a dcoumentation to explain how it works https://handsontable.com/docs/7.1.1/demo-multicolumn-sorting.html

The logic is stored in the plugin’s directory, here https://github.com/handsontable/handsontable/tree/d0aac96b07497347eba7d8307c5b70e0081410f4/src/plugins/multiColumnSorting