1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "bSort" );
4 $(document).ready( function () {
5 /* Check the default */
6 $('#example').dataTable( {
11 "Sorting is on by default",
13 function () { return $('#example tbody td:eq(0)').html() == "Gecko"; }
17 "Sorting Asc by default class applied",
19 function () { return $('#example thead th:eq(0)').hasClass("sorting_asc"); }
23 "Click on second column",
24 function () { $('#example thead th:eq(1)').click(); },
25 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
29 "Sorting class removed from first column",
31 function () { return $('#example thead th:eq(0)').hasClass("sorting_asc") != true; }
35 "Sorting asc class applied to second column",
37 function () { return $('#example thead th:eq(1)').hasClass("sorting_asc"); }
41 "Reverse on second column",
42 function () { $('#example thead th:eq(1)').click(); },
43 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
47 "Sorting acs class removed from second column",
49 function () { return $('#example thead th:eq(1)').hasClass("sorting_asc") != true; }
53 "Sorting desc class applied to second column",
55 function () { return $('#example thead th:eq(1)').hasClass("sorting_desc"); }
58 /* Check can disable */
60 "Pagiantion can be disabled",
63 $('#example').dataTable( {
68 function () { return $('#example tbody td:eq(3)').html() == "4"; }
72 "Click on second column has no effect",
73 function () { $('#example thead th:eq(1)').click(); },
74 function () { return $('#example tbody td:eq(3)').html() == "4"; }
78 "Reverse on second column has no effect",
79 function () { $('#example thead th:eq(1)').click(); },
80 function () { return $('#example tbody td:eq(3)').html() == "4"; }
83 /* Enable makes no difference */
85 "Sorting enabled override",
88 $('#example').dataTable( {
93 function () { return $('#example tbody td:eq(0)').html() == "Gecko"; }