From 2c76d845d6e3e66e6157c33294e640248f9761d2 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Tue, 17 Aug 2010 19:00:46 +0100 Subject: [PATCH] Fixed: Columns with zero length strings only in them and with a given width would be missed from the width calculations - 2530 --- .../unit_testing/templates/dymanic_table.php | 45 +++++++++++++++++++ media/unit_testing/tests_onhold/1_dom/2530.js | 29 ++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 media/unit_testing/templates/dymanic_table.php create mode 100755 media/unit_testing/tests_onhold/1_dom/2530.js diff --git a/media/unit_testing/templates/dymanic_table.php b/media/unit_testing/templates/dymanic_table.php new file mode 100644 index 00000000..7e32ff34 --- /dev/null +++ b/media/unit_testing/templates/dymanic_table.php @@ -0,0 +1,45 @@ + + + + + + + DataTables unit testing + + + + + + '."\n"; + } + ?> + + +
+
+ DataTables dynamic table template +
+ +

Live example

+
+
+
+ + \ No newline at end of file diff --git a/media/unit_testing/tests_onhold/1_dom/2530.js b/media/unit_testing/tests_onhold/1_dom/2530.js new file mode 100755 index 00000000..29e642d7 --- /dev/null +++ b/media/unit_testing/tests_onhold/1_dom/2530.js @@ -0,0 +1,29 @@ +// DATA_TEMPLATE: dymanic_table +oTest.fnStart( "2530 - Check width's when dealing with empty strings" ); + + +$(document).ready( function () { + $('#example').dataTable( { + "aaData": [ + ['','Internet Explorer 4.0','Win 95+','4','X'], + ['','Internet Explorer 5.0','Win 95+','5','C'] + ], + "aoColumns": [ + { "sTitle": "", "sWidth": "40px" }, + { "sTitle": "Browser" }, + { "sTitle": "Platform" }, + { "sTitle": "Version", "sClass": "center" }, + { "sTitle": "Grade", "sClass": "center" } + ] + } ); + + /* Basic checks */ + oTest.fnTest( + "Check calculated widths", + null, + function () { return $('#example tbody tr td:eq(0)').width() < 100; } + ); + + + oTest.fnComplete(); +} ); \ No newline at end of file