mirror of
https://github.com/DataTables/DataTables.git
synced 2025-03-15 16:29:16 +01:00
Updated: When throwing an error, throw a "new Error()" so we can get a bit more information about the error
Updated: When using custom sort data types, if the returned array is not of the required length (aoData.length), then an error is thrown
This commit is contained in:
parent
409edd791b
commit
793020a8d4
13
media/js/jquery.dataTables.js
vendored
13
media/js/jquery.dataTables.js
vendored
@ -3798,9 +3798,16 @@
|
|||||||
if ( DataTable.ext.afnSortData[sDataType] )
|
if ( DataTable.ext.afnSortData[sDataType] )
|
||||||
{
|
{
|
||||||
var aData = DataTable.ext.afnSortData[sDataType]( oSettings, iColumn, iVisColumn );
|
var aData = DataTable.ext.afnSortData[sDataType]( oSettings, iColumn, iVisColumn );
|
||||||
for ( j=0, jLen=aoData.length ; j<jLen ; j++ )
|
if ( aData.length === aoData.length )
|
||||||
{
|
{
|
||||||
_fnSetCellData( oSettings, j, iColumn, aData[j] );
|
for ( j=0, jLen=aoData.length ; j<jLen ; j++ )
|
||||||
|
{
|
||||||
|
_fnSetCellData( oSettings, j, iColumn, aData[j] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_fnLog( oSettings, 0, "Returned data sort array (col "+iColumn+") is the wrong length" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4533,7 +4540,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw sAlert;
|
throw new Error(sAlert);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -42,9 +42,16 @@ function _fnSort ( oSettings, bApplyClasses )
|
|||||||
if ( DataTable.ext.afnSortData[sDataType] )
|
if ( DataTable.ext.afnSortData[sDataType] )
|
||||||
{
|
{
|
||||||
var aData = DataTable.ext.afnSortData[sDataType]( oSettings, iColumn, iVisColumn );
|
var aData = DataTable.ext.afnSortData[sDataType]( oSettings, iColumn, iVisColumn );
|
||||||
for ( j=0, jLen=aoData.length ; j<jLen ; j++ )
|
if ( aData.length === aoData.length )
|
||||||
{
|
{
|
||||||
_fnSetCellData( oSettings, j, iColumn, aData[j] );
|
for ( j=0, jLen=aoData.length ; j<jLen ; j++ )
|
||||||
|
{
|
||||||
|
_fnSetCellData( oSettings, j, iColumn, aData[j] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_fnLog( oSettings, 0, "Returned data sort array (col "+iColumn+") is the wrong length" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -121,7 +121,7 @@ function _fnLog( oSettings, iLevel, sMesg )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw sAlert;
|
throw new Error(sAlert);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user