1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-01-30 23:52:11 +01:00

Fix: afnSortData functions were not being executed with the DataTables instance's scope

This commit is contained in:
Allan Jardine 2012-03-19 12:09:49 +00:00
parent b5f4938d7d
commit 2096244c60
2 changed files with 6 additions and 2 deletions

View File

@ -3796,7 +3796,9 @@
sDataType = oSettings.aoColumns[ iColumn ].sSortDataType; sDataType = oSettings.aoColumns[ iColumn ].sSortDataType;
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].call(
oSettings.oInstance, oSettings, iColumn, iVisColumn
);
if ( aData.length === aoData.length ) if ( aData.length === aoData.length )
{ {
for ( j=0, jLen=aoData.length ; j<jLen ; j++ ) for ( j=0, jLen=aoData.length ; j<jLen ; j++ )

View File

@ -36,7 +36,9 @@ function _fnSort ( oSettings, bApplyClasses )
sDataType = oSettings.aoColumns[ iColumn ].sSortDataType; sDataType = oSettings.aoColumns[ iColumn ].sSortDataType;
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].call(
oSettings.oInstance, oSettings, iColumn, iVisColumn
);
if ( aData.length === aoData.length ) if ( aData.length === aoData.length )
{ {
for ( j=0, jLen=aoData.length ; j<jLen ; j++ ) for ( j=0, jLen=aoData.length ; j<jLen ; j++ )