1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "aoColumns.bVisible" );
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
9 var oSettings = oTable.fnSettings();
12 "All columns are visible by default",
14 function () { return $('#example tbody tr:eq(0) td').length == 5; }
18 "Can hide one column and it removes td column from DOM",
21 $('#example').dataTable( {
25 { "bVisible": false },
32 function () { return $('#example tbody tr:eq(0) td').length == 4; }
36 "Can hide one column and it removes thead th column from DOM",
38 function () { return $('#example thead tr:eq(0) th').length == 4; }
42 "Can hide one column and it removes tfoot th column from DOM",
44 function () { return $('#example tfoot tr:eq(0) th').length == 4; }
48 "The correct tbody column has been hidden",
50 oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } );
53 var jqNodes = $('#example tbody tr:eq(0) td');
55 jqNodes[0].innerHTML == "Gecko" &&
56 jqNodes[1].innerHTML == "Gnome" &&
57 jqNodes[2].innerHTML == "1.8" &&
58 jqNodes[3].innerHTML == "A";
65 "Can hide multiple columns and it removes td column from DOM",
68 $('#example').dataTable( {
72 { "bVisible": false },
73 { "bVisible": false },
79 function () { return $('#example tbody tr:eq(0) td').length == 2; }
83 "Multiple hide - removes thead th column from DOM",
85 function () { return $('#example thead tr:eq(0) th').length == 2; }
89 "Multiple hide - removes tfoot th column from DOM",
91 function () { return $('#example tfoot tr:eq(0) th').length == 2; }
95 "Multiple hide - the correct tbody columns have been hidden",
97 oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } );
100 var jqNodes = $('#example tbody tr:eq(0) td');
102 jqNodes[0].innerHTML == "Gecko" &&
103 jqNodes[1].innerHTML == "1"