From fb20b17856cad8bc1656ca1a34e178884f8c091d Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 14 Sep 2010 18:51:41 +0100 Subject: [PATCH] Fixed: When destroying a table which had been filtered to no results, the 'No results' row was not automatically removed, returning in the table being unable to be re-initialised (since it has a colspan). Fixed: Now use escape() and unescape() for state saving cookie with the filtering strings - 2608 --- media/js/jquery.dataTables.js | 11 +++-- media/unit_testing/tests_onhold/1_dom/2608.js | 40 +++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) create mode 100755 media/unit_testing/tests_onhold/1_dom/2608.js diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index a8289f65..29b01c61 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2058,6 +2058,9 @@ } } + /* If there is an 'empty' indicator row, remove it */ + $('tbody>tr>td.'+oSettings.oClasses.sRowEmpty, oSettings.nTable).parent().remove(); + /* When scrolling we had to break the table up - restore it */ if ( oSettings.nTable != oSettings.nTHead.parentNode ) { @@ -5733,7 +5736,7 @@ sValue += '"iStart":'+ oSettings._iDisplayStart+','; sValue += '"iEnd":'+ oSettings._iDisplayEnd+','; sValue += '"iLength":'+ oSettings._iDisplayLength+','; - sValue += '"sFilter":"'+ oSettings.oPreviousSearch.sSearch.replace('"','\\"')+'",'; + sValue += '"sFilter":"'+ escape(oSettings.oPreviousSearch.sSearch)+'",'; sValue += '"sFilterEsc":'+ !oSettings.oPreviousSearch.bRegex+','; sValue += '"aaSorting":['; @@ -5747,7 +5750,7 @@ sValue += '"aaSearchCols":['; for ( i=0 ; i