1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aoColumns.bVisible" );
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
8 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
10 var oSettings = oTable.fnSettings();
13 "All columns are visible by default",
15 function () { return $('#example tbody tr:eq(0) td').length == 5; }
19 "Can hide one column and it removes td column from DOM",
22 $('#example').dataTable( {
24 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
27 { "bVisible": false },
34 function () { return $('#example tbody tr:eq(0) td').length == 4; }
38 "Can hide one column and it removes thead th column from DOM",
40 function () { return $('#example thead tr:eq(0) th').length == 4; }
44 "The correct thead column has been hidden",
47 var jqNodes = $('#example thead tr:eq(0) th');
49 jqNodes[0].innerHTML == "Rendering engine" &&
50 jqNodes[1].innerHTML == "Platform(s)" &&
51 jqNodes[2].innerHTML == "Engine version" &&
52 jqNodes[3].innerHTML == "CSS grade";
58 "The correct tbody column has been hidden",
61 var jqNodes = $('#example tbody tr:eq(0) td');
63 jqNodes[0].innerHTML == "Gecko" &&
64 jqNodes[1].innerHTML == "Win 98+ / OSX.2+" &&
65 jqNodes[2].innerHTML == "1.7" &&
66 jqNodes[3].innerHTML == "A";
73 "Can hide multiple columns and it removes td column from DOM",
76 $('#example').dataTable( {
78 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
81 { "bVisible": false },
82 { "bVisible": false },
88 function () { return $('#example tbody tr:eq(0) td').length == 2; }
92 "Multiple hide - removes thead th column from DOM",
94 function () { return $('#example thead tr:eq(0) th').length == 2; }
98 "Multiple hide - the correct thead columns have been hidden",
101 var jqNodes = $('#example thead tr:eq(0) th');
103 jqNodes[0].innerHTML == "Rendering engine" &&
104 jqNodes[1].innerHTML == "Engine version"
110 "Multiple hide - the correct tbody columns have been hidden",
113 var jqNodes = $('#example tbody tr:eq(0) td');
115 jqNodes[0].innerHTML == "Gecko" &&
116 jqNodes[1].innerHTML == "1.7"