a.toLowerCase is not a function
a.toLowerCase is not a function
jazzyjay
Posts: 4Questions: 0Answers: 0
When my table contains some empty cells (i.e only some TDs are empty), calling .fnDraw() throws the following error:
a.toLowerCase is not a function
return false})}}};_oExt.oSort={"string-asc":function(a,b){var x=a.toLowerCase();var y=b.toLowerCase();
line 63
File: jquery.dataTables.min.js
Version: 1.5.0
I should mention that the table is being sorted by the column in which empty cells appear when I call fnDraw().
Regards
Juraj
a.toLowerCase is not a function
return false})}}};_oExt.oSort={"string-asc":function(a,b){var x=a.toLowerCase();var y=b.toLowerCase();
line 63
File: jquery.dataTables.min.js
Version: 1.5.0
I should mention that the table is being sorted by the column in which empty cells appear when I call fnDraw().
Regards
Juraj
This discussion has been closed.
Replies
a.toLowerCase is not a function
var y=b.toLowerCase();return((x
line 76
[code]
"string-desc":function(a,b){a=a+''; var x=a.toLowerCase();b=b+'';
var y=b.toLowerCase();return((xy)?-1:0))}
[/code]
J.
I'm not seeing this problem with empty cells. Could you possibly post an example showing this issue so I can get a patch in for it?
Thanks,
Allan
[code]
{
"sEcho":"3",
"iTotalRecords":"20",
"iTotalDisplayRecords":"20",
"aaData":
[
["1","Scrappy","McGee","*0*6*11*"],
["2","Jasons","Rice","*0*6*11*1*"],
["3","Skippy","McGee","*0*6*11*1*2*"],
["13","Skippy","McGee","*0*6*11*12*"],
["12",null,null,"*0*6*11*"],
["17","Skippy","McGee","*0*6*11*"],
["18",null,null,"*0*6*11*17*"],
["19",null,null,"*0*6*11*17*"],
["25",null,null,"*0*6*11*17*"],
["30",null,null,"*0*6*11*"]
]
}
[/code]
The sort buttons only cause a javascript error when clicked on columns that contain a cell with a null value. This is not an issue when an empty string is used in lieu of null.
Hope this helps.
Yes indeed, 'null' will most certainly cause this error. If DataTables thinks that the information in that column is a string, then it will act on it as such. If it is given null, then there are of course no methods or properties attached, and thus the error seen. The way to deal with this is not to use null (what does null mean to a table cell? Empty or not present, or perhaps something else?) but rather use an empty string.
Hope this clarifies the situation.
Regards,
Allan