mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-20 18:54:15 +01:00
Fixed: Data casting is now done after fnRender is called. This means that if you pass fnAddData a number, you'll get a number, and not the number cast as a string - 2611.
This commit is contained in:
parent
713008b997
commit
6031c3d0bb
17
media/js/jquery.dataTables.js
vendored
17
media/js/jquery.dataTables.js
vendored
@ -2507,15 +2507,6 @@
|
||||
aData[i] = '';
|
||||
}
|
||||
|
||||
/* Cast everything as a string - this allows us to treat everything accurately in the
|
||||
* sorting functions
|
||||
*/
|
||||
if ( typeof aData[i] != 'string' )
|
||||
{
|
||||
aData[i] += "";
|
||||
}
|
||||
aData[i] = $.trim(aData[i]);
|
||||
|
||||
if ( typeof oSettings.aoColumns[i].fnRender == 'function' )
|
||||
{
|
||||
var sRendered = oSettings.aoColumns[i].fnRender( {
|
||||
@ -2536,6 +2527,14 @@
|
||||
nTd.innerHTML = aData[i];
|
||||
}
|
||||
|
||||
/* Cast everything as a string - so we can treat everything equally when sorting */
|
||||
if ( typeof aData[i] != 'string' )
|
||||
{
|
||||
aData[i] += "";
|
||||
}
|
||||
aData[i] = $.trim(aData[i]);
|
||||
|
||||
/* Add user defined class */
|
||||
if ( oSettings.aoColumns[i].sClass !== null )
|
||||
{
|
||||
nTd.className = oSettings.aoColumns[i].sClass;
|
||||
|
Loading…
x
Reference in New Issue
Block a user