Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 1_dom / 2914-state-save-sort.js
1 // DATA_TEMPLATE: dom_data
2 oTest.fnStart( "2914 - State saving with an empty array" );
3
4 $(document).ready( function () {
5         document.cookie = "";
6         $('#example').dataTable( {
7                 "bStateSave": true,
8                 "aaSorting": []
9         } );
10         
11         oTest.fnTest( 
12                 "No sort",
13                 null,
14                 function () { return $('#example tbody td:eq(3)').html() == "4"; }
15         );
16         
17         oTest.fnTest( 
18                 "Next page",
19                 function () {
20                         $('#example').dataTable().fnPageChange( 'next' );
21                 },
22                 function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
23         );
24         
25         oTest.fnTest( 
26                 "Destroy the table and remake it - checking we are still on the next page",
27                 function () {
28                         $('#example').dataTable( {
29                                 "bStateSave": true,
30                                         "aaSorting": [],
31                                 "bDestroy": true
32                         } );
33                 },
34                 function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
35         );
36         
37         oTest.fnCookieDestroy( $('#example').dataTable() );
38         oTest.fnComplete();
39 } );