From a070ccc2b31a84cd37936f293b2d1662377290a2 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Wed, 29 May 2013 09:13:49 +0100 Subject: [PATCH] Build - latest changes --- media/js/jquery.dataTables.js | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index b13d9c9e..cc3cae4e 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2393,11 +2393,13 @@ } else { + var invalidated = _fnBuildSearchArray( oSettings, 1 ); + /* * We are starting a new search or the new search string is smaller * then the old one (i.e. delete). Search from the master array */ - if ( oSettings.aiDisplay.length == oSettings.aiDisplayMaster.length || + if ( invalidated || oSettings.aiDisplay.length == oSettings.aiDisplayMaster.length || oPrevSearch.sSearch.length > sInput.length || iForce == 1 || sInput.indexOf(oPrevSearch.sSearch) !== 0 ) { @@ -2450,22 +2452,27 @@ { var searchData = []; var i, ien, rows; + var wasInvalidated = false; if ( !settings.oFeatures.bServerSide ) { // Resolve any invalidated rows - _fnFilterData( settings ); + wasInvalidated = _fnFilterData( settings ); - // Build the search array from the display arrays - rows = master===1 ? - settings.aiDisplayMaster : - settings.aiDisplay; + if ( wasInvalidated ) { + // Build the search array from the display arrays + rows = master===1 ? + settings.aiDisplayMaster : + settings.aiDisplay; - for ( i=0, ien=rows.length ; i