Permalink
Browse files

Fix: afnSortData functions were not being executed with the DataTable…

…s instance's scope
  • Loading branch information...
1 parent b5f4938 commit 2096244c60e1804845bd2d01f93fb02447c10622 @DataTables committed Mar 19, 2012
Showing with 6 additions and 2 deletions.
  1. +3 −1 media/js/jquery.dataTables.js
  2. +3 −1 media/src/core/core.sort.js
@@ -3796,7 +3796,9 @@
sDataType = oSettings.aoColumns[ iColumn ].sSortDataType;
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 )
{
for ( j=0, jLen=aoData.length ; j<jLen ; j++ )
@@ -36,7 +36,9 @@ function _fnSort ( oSettings, bApplyClasses )
sDataType = oSettings.aoColumns[ iColumn ].sSortDataType;
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 )
{
for ( j=0, jLen=aoData.length ; j<jLen ; j++ )

0 comments on commit 2096244

Please sign in to comment.