Blanks in date column causes string sort - continued
Blanks in date column causes string sort - continued
owanneke
Posts: 3Questions: 0Answers: 0
Referring to http://www.datatables.net/forums/discussion/4904/blanks-in-the-date-column-causes-string-sort/p1,
when I use a custom date sorting function via a type detection (dynamic columns cannot set predefined type), the sorting function is still switching to string, when there is no value in a table cell, yet there are some HTML tags in the cell.
ie
[code] [/code]
The solution in the original case consists of setting the detected type to undefined for blank cells, is this something I can do from my type detection function as well? I tried to return "undefined", yet that does not work.
[code]
var sInput = sData.replace(/<[^>]+>/g,'');
if (sInput.length == 0) {
return undefined;
}
[/code]
Is there a way to tell from the type detection function to stop detection on this cell and move on to the next, hence preventing a string match caused by the html tags?
when I use a custom date sorting function via a type detection (dynamic columns cannot set predefined type), the sorting function is still switching to string, when there is no value in a table cell, yet there are some HTML tags in the cell.
ie
[code] [/code]
The solution in the original case consists of setting the detected type to undefined for blank cells, is this something I can do from my type detection function as well? I tried to return "undefined", yet that does not work.
[code]
var sInput = sData.replace(/<[^>]+>/g,'');
if (sInput.length == 0) {
return undefined;
}
[/code]
Is there a way to tell from the type detection function to stop detection on this cell and move on to the next, hence preventing a string match caused by the html tags?
This discussion has been closed.