I've tried it in Firefox and in IE7, doesn't work.
Is it correct of me to change the code like below? ..or is it somewhere else I should do the change?
[code]
/*
* Variable: oSort
* Purpose: Wrapper for the sorting functions that can be used in DataTables
* Scope: jQuery.fn.dataTableExt
* Notes: The functions provided in this object are basically standard javascript sort
* functions - they expect two inputs which they then compare and then return a priority
* result. For each sort method added, two functions need to be defined, an ascending sort and
* a descending sort.
*/
_oExt.oSort = {
/*
* text sorting
*/
"string-asc": function ( a, b )
{
var x = a.toLowerCase();
var y = b.toLowerCase();
return x.localeCompare(y);
//return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},
"string-desc": function ( a, b )
{
var x = a.toLowerCase();
var y = b.toLowerCase();
return y.localeCompare(x);
//return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},
[/code]
Yes that's how I think it would be used ( http://msdn.microsoft.com/en-us/library/62b7ahzy(VS.85).aspx ). If that doesn't work, try adding in some debug expressions to see what IE thinks it is doing... I haven't really used this function much myself, so I'm not sure of how much help I'll be able to be...
Replies
Have a look at this thread which covers this topic: http://datatables.net/forums/comments.php?DiscussionID=397 .
Regards,
Allan
Is it correct of me to change the code like below? ..or is it somewhere else I should do the change?
[code]
/*
* Variable: oSort
* Purpose: Wrapper for the sorting functions that can be used in DataTables
* Scope: jQuery.fn.dataTableExt
* Notes: The functions provided in this object are basically standard javascript sort
* functions - they expect two inputs which they then compare and then return a priority
* result. For each sort method added, two functions need to be defined, an ascending sort and
* a descending sort.
*/
_oExt.oSort = {
/*
* text sorting
*/
"string-asc": function ( a, b )
{
var x = a.toLowerCase();
var y = b.toLowerCase();
return x.localeCompare(y);
//return ((x < y) ? -1 : ((x > y) ? 1 : 0));
},
"string-desc": function ( a, b )
{
var x = a.toLowerCase();
var y = b.toLowerCase();
return y.localeCompare(x);
//return ((x < y) ? 1 : ((x > y) ? -1 : 0));
},
[/code]
Yes that's how I think it would be used ( http://msdn.microsoft.com/en-us/library/62b7ahzy(VS.85).aspx ). If that doesn't work, try adding in some debug expressions to see what IE thinks it is doing... I haven't really used this function much myself, so I'm not sure of how much help I'll be able to be...
Regards,
Allan