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