From 815ca8e59da011ebf9e451c2f221c59b893a8085 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 8 Nov 2016 16:05:24 +0000 Subject: [PATCH] Fix ordering: natural sort with case insensitive wasn't working - #281 --- sorting/natural.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sorting/natural.js b/sorting/natural.js index 461c3db..e5873db 100644 --- a/sorting/natural.js +++ b/sorting/natural.js @@ -94,10 +94,6 @@ function naturalSort (a, b, html) { } jQuery.extend( jQuery.fn.dataTableExt.oSort, { - "natural-ci-pre": function ( a ) { - return a.toString().toLowerCase(); - }, - "natural-asc": function ( a, b ) { return naturalSort(a,b,true); }, @@ -115,10 +111,16 @@ jQuery.extend( jQuery.fn.dataTableExt.oSort, { }, "natural-ci-asc": function( a, b ) { + a = a.toString().toLowerCase(); + b = b.toString().toLowerCase(); + return naturalSort(a,b,true); }, "natural-ci-desc": function( a, b ) { + a = a.toString().toLowerCase(); + b = b.toString().toLowerCase(); + return naturalSort(a,b,true) * -1; } } );