Datatable Header sort Stange Behaviour

Hi all,
please check this https://snippet.webix.com/edok00r6
I really do not understand why when I click on the second header the sort result changes in three different asc/desc. it should be only two different resultasc/des
Thanks

Hello, @codejoin

The datatable in your snippet has empty cells. Such sort behavior is caused by the nature of the native javascript sorting mechanic, it uses the Fastsort algorithm, which doesn’t guarantee that order of equal items will be preserved.
The only way to achieve more restricted behavior is to create your own Custom sorting function
You can use something like next
if (a.some == b.som) return a.id > b.id ? 1 : -1;
Which will sort items with equal value by their id ( so their order will be always the same )

Tank you for the answer