Rev | Line | |
---|
[6286] | 1 | // DATA_TEMPLATE: dom_data |
---|
| 2 | oTest.fnStart( "2635 - Hiding column and state saving" ); |
---|
| 3 | |
---|
| 4 | $(document).ready( function () { |
---|
| 5 | $('#example').dataTable( { |
---|
| 6 | "bStateSave": true |
---|
| 7 | } ); |
---|
| 8 | |
---|
| 9 | oTest.fnTest( |
---|
| 10 | "Set the hidden column", |
---|
| 11 | function () { |
---|
| 12 | $('#example').dataTable().fnSetColumnVis( 2, false ); |
---|
| 13 | }, |
---|
| 14 | function () { return $('#example thead th').length == 4; } |
---|
| 15 | ); |
---|
| 16 | |
---|
| 17 | oTest.fnTest( |
---|
| 18 | "Destroy the table and remake it - checking one column was removed", |
---|
| 19 | function () { |
---|
| 20 | $('#example').dataTable( { |
---|
| 21 | "bStateSave": true, |
---|
| 22 | "bDestroy": true |
---|
| 23 | } ); |
---|
| 24 | }, |
---|
| 25 | function () { return $('#example thead th').length == 4; } |
---|
| 26 | ); |
---|
| 27 | |
---|
| 28 | oTest.fnTest( |
---|
| 29 | "Do it again without state saving and make sure we are back to 5 columns", |
---|
| 30 | function () { |
---|
| 31 | $('#example').dataTable( { |
---|
| 32 | "bDestroy": true |
---|
| 33 | } ); |
---|
| 34 | }, |
---|
| 35 | function () { return $('#example thead th').length == 5; } |
---|
| 36 | ); |
---|
| 37 | |
---|
| 38 | oTest.fnCookieDestroy( $('#example').dataTable() ); |
---|
| 39 | oTest.fnComplete(); |
---|
| 40 | } ); |
---|
Note: See
TracBrowser
for help on using the repository browser.