1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "bSort" );
4 $(document).ready( function () {
5 /* Check the default */
6 $('#example').dataTable( {
8 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
12 "Sorting is on by default",
14 function () { return $('#example tbody td:eq(1)').html() == "Firefox 1.0"; }
18 "Sorting Asc by default class applied",
20 function () { return $('#example thead th:eq(0)').hasClass("sorting_asc"); }
24 "Click on second column",
25 function () { $('#example thead th:eq(1)').click(); },
26 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
30 "Sorting class removed from first column",
32 function () { return $('#example thead th:eq(0)').hasClass("sorting_asc") != true; }
36 "Sorting asc class applied to second column",
38 function () { return $('#example thead th:eq(1)').hasClass("sorting_asc"); }
42 "Reverse on second column",
43 function () { $('#example thead th:eq(1)').click(); },
44 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
48 "Sorting acs class removed from second column",
50 function () { return $('#example thead th:eq(1)').hasClass("sorting_asc") != true; }
54 "Sorting desc class applied to second column",
56 function () { return $('#example thead th:eq(1)').hasClass("sorting_desc"); }
59 /* Check can disable */
61 "Pagiantion can be disabled",
64 $('#example').dataTable( {
66 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
70 function () { return $('#example tbody td:eq(3)').html() == "4"; }
74 "Click on second column has no effect",
75 function () { $('#example thead th:eq(1)').click(); },
76 function () { return $('#example tbody td:eq(3)').html() == "4"; }
80 "Reverse on second column has no effect",
81 function () { $('#example thead th:eq(1)').click(); },
82 function () { return $('#example tbody td:eq(3)').html() == "4"; }
85 /* Enable makes no difference */
87 "Sorting enabled override",
90 $('#example').dataTable( {
92 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
96 function () { return $('#example tbody td:eq(1)').html() == "Firefox 1.0"; }