1 |
// DATA_TEMPLATE: dom_data |
2 |
oTest.fnStart( "Destroy with hidden columns" ); |
3 |
|
4 |
$(document).ready( function () { |
5 |
$('#example').dataTable( { |
6 |
"aoColumnDefs": [ |
7 |
{ "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] }, |
8 |
{ "bVisible": false, "aTargets": [ 3 ] } |
9 |
] |
10 |
} ); |
11 |
$('#example').dataTable().fnDestroy(); |
12 |
|
13 |
oTest.fnTest( |
14 |
"Check that the number of columns in table is correct", |
15 |
null, |
16 |
function () { return $('#example tbody tr:eq(0) td').length == 5; } |
17 |
); |
18 |
|
19 |
|
20 |
oTest.fnTest( |
21 |
"And with scrolling", |
22 |
function () { |
23 |
$('#example').dataTable( { |
24 |
"sScrollY": 200, |
25 |
"aoColumnDefs": [ |
26 |
{ "bSearchable": false, "bVisible": false, "aTargets": [ 2 ] }, |
27 |
{ "bVisible": false, "aTargets": [ 3 ] } |
28 |
] |
29 |
} ); |
30 |
$('#example').dataTable().fnDestroy(); |
31 |
}, |
32 |
function () { return $('#example tbody tr:eq(0) td').length == 5; } |
33 |
); |
34 |
|
35 |
oTest.fnComplete(); |
36 |
} ); |