Debian Codegraph @

old-tests/tests_onhold/4_server-side/aaSortingFixed.js

raw
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aaSortingFixed" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "bServerSide": true,
8 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
9 } );
10 var oSettings = oTable.fnSettings();
11
12 oTest.fnWaitTest(
13 "No fixed sorting by default",
14 null,
15 function () {
16 return oSettings.aaSortingFixed == null;
17 }
18 );
19
20
21 oTest.fnWaitTest(
22 "Fixed sorting on first column (string/asc) with user sorting on second column (string/asc)",
23 function () {
24 oSession.fnRestore();
25 $('#example').dataTable( {
26 "bServerSide": true,
27 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
28 "aaSortingFixed": [['0','asc']]
29 } );
30 $('#example thead th:eq(1)').click();
31 },
32 function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
33 );
34
35 oTest.fnWaitTest(
36 "Fixed sorting on first column (string/asc) with user sorting on second column (string/desc)",
37 function () {
38 $('#example thead th:eq(1)').click();
39 },
40 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
41 );
42
43 oTest.fnWaitTest(
44 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/asc)",
45 function () {
46 oSession.fnRestore();
47 $('#example').dataTable( {
48 "bServerSide": true,
49 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
50 "aaSortingFixed": [['3','asc']]
51 } );
52 $('#example thead th:eq(1)').click();
53 },
54 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
55 );
56
57 oTest.fnWaitTest(
58 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/desc)",
59 function () {
60 $('#example thead th:eq(1)').click();
61 },
62 function () { return $('#example tbody td:eq(1)').html() == "PSP browser"; }
63 );
64
65
66 oTest.fnComplete();
67 } );