Sorting problem in Nulls
Sorting problem in Nulls
For string sorting, If sorting alphabetically it should put the blanks at the bottom. And reverse alphabetically blanks at the top.
Is it possible in following custom sorting? Please correct this following custom sorting?
jQuery.fn.dataTableExt.oSort['mystring-asc'] = function(x,y) {
if (x==y) return 0;
if (x == "") return -1;
if (y == "") return 1;
if (x > y) return 1;
}
jQuery.fn.dataTableExt.oSort['mystring-desc'] = function(y,x) {
if (x==y) return 0;
if (x == "") return -1;
if (y == "") return 1;
if (x > y) return 1;
}
Is it possible in following custom sorting? Please correct this following custom sorting?
jQuery.fn.dataTableExt.oSort['mystring-asc'] = function(x,y) {
if (x==y) return 0;
if (x == "") return -1;
if (y == "") return 1;
if (x > y) return 1;
}
jQuery.fn.dataTableExt.oSort['mystring-desc'] = function(y,x) {
if (x==y) return 0;
if (x == "") return -1;
if (y == "") return 1;
if (x > y) return 1;
}
This discussion has been closed.
Replies
Allan
My expected output is:
When sorting alphabetically or reverse alphabetically by Rendering engine columnn, it puts it in a random order
If sorting alphabetically it should put the "."(dot) at the bottom. And reverse alphabetically "."(dot) at the top.
But i didn't get the answer.
I have posted a test case on http://live.datatables.net/iqadal/36/edit#javascript,live
Please help to get this answer. I have tried so many hours but i didn't get the answer
Allan
sorting is working fine but it puts it in a random order when ascending or decending(except '.'). Its not sorting properly in all data.
When decending:(Issue)
EED
ERD
GEC
RED
RED
TRD
TRE
WEB
cre
her
jish
jos
ked
.
.
.
.
.
In above result ,when ascending uppercase datas are sorted first then lower case datas have sorted next.Its wrong.
Its sorting in both uppercase and lowercase properly. Is it possible to correct this issue?