From 2f729af697f4b54dad00619c4adc57029939beaf Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sat, 7 Jan 2012 12:55:28 +0000 Subject: [PATCH] Fix: Made a mistake when updating the conditionals for fnFilter and fnGetData when considering rows. if ( 0 ) is of course false - so passing in an integer isn't valid - need to check for undefined - 7997 --- media/js/jquery.dataTables.js | 8 ++++---- media/src/api/api.methods.js | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index c938c185..1bf8c833 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -4920,7 +4920,7 @@ oSettings.aiDisplay = oSettings.aiDisplayMaster.slice(); - if ( bRedraw ) + if ( bRedraw === undefined || bRedraw ) { _fnReDraw( oSettings ); } @@ -5300,7 +5300,7 @@ bCaseInsensitive = true; } - if ( !iColumn ) + if ( iColumn === undefined || iColumn === null ) { /* Global filter */ _fnFilterComplete( oSettings, { @@ -5370,7 +5370,7 @@ var iRow = (typeof mRow === 'object') ? _fnNodeToDataIndex(oSettings, mRow) : mRow; - if ( iCol ) + if ( iCol !== undefined ) { return _fnGetCellData( oSettings, iRow, iCol, '' ); } @@ -5400,7 +5400,7 @@ { var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] ); - return (iRow) ? + return (iRow !== undefined) ? oSettings.aoData[iRow].nTr : _fnGetTrNodes( oSettings ); }; diff --git a/media/src/api/api.methods.js b/media/src/api/api.methods.js index 3bcc2349..0cf63f26 100644 --- a/media/src/api/api.methods.js +++ b/media/src/api/api.methods.js @@ -561,7 +561,7 @@ this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseIns bCaseInsensitive = true; } - if ( !iColumn ) + if ( iColumn === undefined || iColumn === null ) { /* Global filter */ _fnFilterComplete( oSettings, { @@ -631,7 +631,7 @@ this.fnGetData = function( mRow, iCol ) var iRow = (typeof mRow === 'object') ? _fnNodeToDataIndex(oSettings, mRow) : mRow; - if ( iCol ) + if ( iCol !== undefined ) { return _fnGetCellData( oSettings, iRow, iCol, '' ); } @@ -661,7 +661,7 @@ this.fnGetNodes = function( iRow ) { var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] ); - return (iRow) ? + return (iRow !== undefined) ? oSettings.aoData[iRow].nTr : _fnGetTrNodes( oSettings ); };