Open GoogleCodeExporter opened 8 years ago
Original comment by joc...@gmail.com
on 29 May 2013 at 8:22
This issue crops up for me if the column I attempt to group on contains a bare
number. The following data will trigger the error.
{
"data": [
[
1,
"George Washington",
"US President",
"New York City",
],
[
1,
"Abraham Lincoln",
"US President",
"Washington DC",
]
]
}
The exception occurs in the function _fnGetCleanedGroup which assumes its
argument will always be a string. Since column data in DataTables is not always
a string, this is a problemattic. I propose that the body of _fnGetCleanedGroup
should be changed to something similar to the following:
function _fnGetCleanedGroup(sGroup) {
var rval = sGroup;
if (typeof sGroup != 'string') {
rval = JSON.stringify(sGroup);
}
if (rval === "")
return "-";
return rval.toLowerCase().replace(
/[^a-zA-Z0-9\u0080-\uFFFF]+/g, "-"); //fix for unicode characters (Issue 23)
//return sGroup.toLowerCase().replace(/\W+/g, "-"); //Fix provided by bmathews (Issue 7)
}
Original comment by tim.v...@gmail.com
on 13 Mar 2015 at 10:17
Original issue reported on code.google.com by
Penkov.V...@gmail.com
on 30 Jul 2012 at 9:12