I added the code to your extension (DataTables Sorting plugins), but it doesn’t work.
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"locale-compare-asc": function ( a, b ) {
return a.localeCompare(b, 'uk', { sensitivity: 'accent' })
},
"locale-compare-desc": function ( a, b ) {
return b.localeCompare(a, 'uk', { sensitivity: 'accent' })
}
});
var table = $('#example').DataTable({
columnDefs : [
{ targets: 0, type: 'locale-compare' }
]
});
-
This reply was modified 3 years ago by merkator.