From 29d7a0a182c89d4326d302013c6a44becbec23d1 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Sun, 22 Aug 2010 08:47:06 +0100 Subject: [PATCH] Fixed: fnDestroy didn't restore columns which had been hidden by DataTables, resulting in these columns being completely lost - 2569 --- examples/basic_init/hidden_columns.html | 1 + examples/basic_init/zero_config.html | 2 +- media/js/jquery.dataTables.js | 9 +++++++++ media/unit_testing/tests_onhold/1_dom/2569.js | 20 +++++++++++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 media/unit_testing/tests_onhold/1_dom/2569.js diff --git a/examples/basic_init/hidden_columns.html b/examples/basic_init/hidden_columns.html index c9e31ed3..41e98f6e 100644 --- a/examples/basic_init/hidden_columns.html +++ b/examples/basic_init/hidden_columns.html @@ -18,6 +18,7 @@ { "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] }, { "bVisible": false, "aTargets": [ 3 ] } ] } ); + $('#example').dataTable().fnDestroy(); } ); diff --git a/examples/basic_init/zero_config.html b/examples/basic_init/zero_config.html index e7eda320..26f84812 100644 --- a/examples/basic_init/zero_config.html +++ b/examples/basic_init/zero_config.html @@ -28,7 +28,7 @@

Live example

- +
diff --git a/media/js/jquery.dataTables.js b/media/js/jquery.dataTables.js index b3341e2f..6807a7b0 100644 --- a/media/js/jquery.dataTables.js +++ b/media/js/jquery.dataTables.js @@ -2040,6 +2040,15 @@ var nBody = oSettings.nTBody; var i, iLen; + /* Restore hidden columns */ + for ( i=0, iLen=oSettings.aoColumns.length ; i
Rendering engine