1 // DATA_TEMPLATE: dom_data_two_headers
2 oTest.fnStart( "bSortCellsTop" );
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable();
7 var oSettings = oTable.fnSettings();
10 "Sorting class is on the bottom cells by default",
12 function () { return $('#example thead tr:eq(1) th:eq(0)').hasClass('sorting_asc'); }
16 "Sorting is performed on bottom cells",
17 function () { return $('#example thead tr:eq(1) th:eq(0)').click(); },
18 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
22 "Sorting class is updated on the bottom cells",
24 function () { return $('#example thead tr:eq(1) th:eq(0)').hasClass('sorting_desc'); }
28 "Clicking on top cells has no effect",
29 function () { return $('#example thead tr:eq(0) th:eq(0)').click(); },
30 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
34 "Clicking on another top cell has no effect",
35 function () { return $('#example thead tr:eq(0) th:eq(3)').click(); },
36 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
41 "Sorting class is on the top cell when bSortCellsTop is true",
44 $('#example').dataTable( {
48 function () { return $('#example thead tr:eq(0) th:eq(0)').hasClass('sorting_asc'); }
52 "Sorting is performed on top cells now",
53 function () { return $('#example thead tr:eq(0) th:eq(0)').click(); },
54 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
58 "Sorting class is updated on the top cells",
60 function () { return $('#example thead tr:eq(0) th:eq(0)').hasClass('sorting_desc'); }
64 "Clicking on bottom cells has no effect",
65 function () { return $('#example thead tr:eq(1) th:eq(0)').click(); },
66 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
70 "Clicking on another bottom cell has no effect",
71 function () { return $('#example thead tr:eq(1) th:eq(3)').click(); },
72 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }