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"
9 var oSettings = oTable.fnSettings();
12 "No fixed sorting by default",
15 return oSettings.aaSortingFixed == null;
21 "Fixed sorting on first column (string/asc) with user sorting on second column (string/asc)",
24 $('#example').dataTable( {
25 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
26 "aaSortingFixed": [['0','asc']],
27 "fnInitComplete": function () {
28 $('#example thead th:eq(1)').click();
33 function () { return $('#example tbody td:eq(1)').html() == "Camino 1.0"; }
37 "Fixed sorting on first column (string/asc) with user sorting on second column (string/desc)",
39 $('#example thead th:eq(1)').click();
41 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
45 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/asc)",
48 $('#example').dataTable( {
49 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
50 "aaSortingFixed": [['3','asc']]
52 $('#example thead th:eq(1)').click();
54 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
58 "Fixed sorting on fourth column (int/asc) with user sorting on second column (string/desc)",
60 $('#example thead th:eq(1)').click();
62 function () { return $('#example tbody td:eq(1)').html() == "PSP browser"; }