From 23fe13c68b7d11295b113ba7e0c7b3bd4aa03645 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 14 Sep 2010 19:43:04 +0100 Subject: [PATCH] Fixed: Column visibility was not being saved when calling fnSetColumnVis. It would require another draw to save the state before - 2635. Fixed: Column visibility was not be restored from the state saving cookie. A small tidy up of the column creation code as well - 2635. --- media/js/jquery.dataTables.js | 37 +++++++++++------- media/unit_testing/tests_onhold/1_dom/2608.js | 13 +++++++ media/unit_testing/tests_onhold/1_dom/2635.js | 39 +++++++++++++++++++ 3 files changed, 75 insertions(+), 14 deletions(-) create mode 100755 media/unit_testing/tests_onhold/1_dom/2635.js diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index 29b01c61..4b9b860c 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2015,6 +2015,7 @@ */ _fnAjustColumnSizing( oSettings ); _fnDraw( oSettings ); + _fnSaveState( oSettings ); }; /* @@ -2049,6 +2050,9 @@ var nBody = oSettings.nTBody; var i, iLen; + /* Flag to note that the table is currently being destoryed - no action should be taken */ + oSettings.bDestroying = true; + /* Restore hidden columns */ for ( i=0, iLen=oSettings.aoColumns.length ; i