1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aaSortingFixed" );
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
10 var oSettings = oTable.fnSettings();
13 "No fixed sorting by default",
16 return oSettings.aaSortingFixed == null;
22 "Fixed sorting on first column (string/asc) with user sorting on second column (string/asc)",
25 $('#example').dataTable( {
26 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
28 "aaSortingFixed": [['0','asc']],
29 "fnInitComplete": function () {
30 $('#example thead th:eq(1)').click();
35 function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
39 "Fixed sorting on first column (string/asc) with user sorting on second column (string/desc)",
41 $('#example thead th:eq(1)').click();
43 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
47 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/asc)",
50 $('#example').dataTable( {
51 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
53 "aaSortingFixed": [['3','asc']]
55 $('#example thead th:eq(1)').click();
57 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
61 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/desc)",
63 $('#example thead th:eq(1)').click();
65 function () { return $('#example tbody td:eq(1)').html() == "PSP browser"; }