1 // DATA_TEMPLATE: dom_data
2 oTest.fnStart( "bSort" );
4 $(document).ready( function () {
5 /* Check the default */
6 $('#example').dataTable();
9 "Sorting is on by default",
11 function () { return $('#example tbody td:eq(0)').html() == "Gecko"; }
15 "Sorting Asc by default class applied",
17 function () { return $('#example thead th:eq(0)').hasClass("sorting_asc"); }
21 "Click on second column",
22 function () { $('#example thead th:eq(1)').click(); },
23 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
27 "Sorting class removed from first column",
29 function () { return $('#example thead th:eq(0)').hasClass("sorting_asc") != true; }
33 "Sorting asc class applied to second column",
35 function () { return $('#example thead th:eq(1)').hasClass("sorting_asc"); }
39 "Reverse on second column",
40 function () { $('#example thead th:eq(1)').click(); },
41 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
45 "Sorting acs class removed from second column",
47 function () { return $('#example thead th:eq(1)').hasClass("sorting_asc") != true; }
51 "Sorting desc class applied to second column",
53 function () { return $('#example thead th:eq(1)').hasClass("sorting_desc"); }
56 /* Check can disable */
58 "Pagiantion can be disabled",
61 $('#example').dataTable( {
65 function () { return $('#example tbody td:eq(3)').html() == "4"; }
69 "Disabled classes applied",
71 function () { return $('#example thead th:eq(0)').hasClass('sorting_disabled'); }
75 "Click on second column has no effect",
76 function () { $('#example thead th:eq(1)').click(); },
77 function () { return $('#example tbody td:eq(3)').html() == "4"; }
81 "Reverse on second column has no effect",
82 function () { $('#example thead th:eq(1)').click(); },
83 function () { return $('#example tbody td:eq(3)').html() == "4"; }
86 /* Enable makes no difference */
88 "Sorting enabled override",
91 $('#example').dataTable( {
95 function () { return $('#example tbody td:eq(0)').html() == "Gecko"; }