Hello, is it possible to do a "natural" sort in datatable ?
I have a custom sort for a specific column (sort:myCustomSort) but I don't know how to do a natural sort , I tried javascript function "localCompare" without success .
Any ideas ?
up ?
Hello @romain , For example, the implementation can look as follows:
webix.DataStore.prototype.sorting.as.sortLocalCompare = function(a,b){ return a.toString().localeCompare(b.toString(), undefined, {numeric: true}); }
Example: https://snippet.webix.com/9xum476y
Perfect thanks
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
up ?
Hello @romain ,
For example, the implementation can look as follows:
Example: https://snippet.webix.com/9xum476y
Perfect thanks