annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/aaSortingFixed.js @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 // DATA_TEMPLATE: empty_table
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 oTest.fnStart( "aaSortingFixed" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 var oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 "No fixed sorting by default",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 return oSettings.aaSortingFixed == null;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 "Fixed sorting on first column (string/asc) with user sorting on second column (string/asc)",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 "aaSortingFixed": [['0','asc']],
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 "fnInitComplete": function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 $('#example thead th:eq(1)').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 //
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 "Fixed sorting on first column (string/asc) with user sorting on second column (string/desc)",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 $('#example thead th:eq(1)').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/asc)",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 "aaSortingFixed": [['3','asc']]
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 $('#example thead th:eq(1)').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/desc)",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 $('#example thead th:eq(1)').click();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 function () { return $('#example tbody td:eq(1)').html() == "PSP browser"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 } );