1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "Custom data source property - property given" );
5 $(document).ready( function () {
7 "sAjaxSource": "../../../examples/ajax/sources/custom_prop.txt",
8 "sAjaxDataProp": "demo"
10 $('#example').dataTable( oInit );
13 "10 rows shown on the first page",
15 function () { return $('#example tbody tr').length == 10; }
19 "Initial sort occured",
21 function () { return $('#example tbody td:eq(0)').html() == "Gecko"; }
24 /* Need to use the WaitTest for sorting due to the setTimeout datatables uses */
26 "Sorting (first click) on second column",
27 function () { $('#example thead th:eq(1)').click(); },
28 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
32 "Sorting (second click) on second column",
33 function () { $('#example thead th:eq(1)').click(); },
34 function () { return $('#example tbody td:eq(1)').html() == "Seamonkey 1.1"; }
38 "Sorting (third click) on second column",
39 function () { $('#example thead th:eq(1)').click(); },
40 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
44 "Sorting (first click) on numeric column",
45 function () { $('#example thead th:eq(3)').click(); },
46 function () { return $('#example tbody td:eq(3)').html() == "-"; }
50 "Sorting (second click) on numeric column",
51 function () { $('#example thead th:eq(3)').click(); },
52 function () { return $('#example tbody td:eq(3)').html() == "522.1"; }
56 "Sorting multi-column (first click)",
58 $('#example thead th:eq(0)').click();
59 oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } ); },
61 $('#example tbody td:eq(0)').html() == "Gecko" &&
62 $('#example tbody td:eq(1)').html() == "Camino 1.0"; return b; }
66 "Sorting multi-column - sorting second column only",
68 $('#example thead th:eq(1)').click(); },
69 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
74 "Paging to second page",
75 function () { $('#example_next').click(); },
76 function () { return $('#example tbody td:eq(1)').html() == "IE Mobile"; }
80 "Paging to first page",
81 function () { $('#example_previous').click(); },
82 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
86 "Attempting to page back beyond the first page",
87 function () { $('#example_previous').click(); },
88 function () { return $('#example tbody td:eq(1)').html() == "All others"; }
93 "Changing table length to 25 records",
94 function () { $("select[name=example_length]").val('25').change(); },
95 function () { return $('#example tbody tr').length == 25; }
99 "Changing table length to 50 records",
100 function () { $("select[name=example_length]").val('50').change(); },
101 function () { return $('#example tbody tr').length == 50; }
105 "Changing table length to 100 records",
106 function () { $("select[name=example_length]").val('100').change(); },
107 function () { return $('#example tbody tr').length == 57; }
111 "Changing table length to 10 records",
112 function () { $("select[name=example_length]").val('10').change(); },
113 function () { return $('#example tbody tr').length == 10; }
117 * Information element
120 "Information on zero config",
122 function () { return document.getElementById('example_info').innerHTML == "Showing 1 to 10 of 57 entries"; }
126 "Information on second page",
127 function () { $('#example_next').click(); },
128 function () { return document.getElementById('example_info').innerHTML == "Showing 11 to 20 of 57 entries"; }
132 "Information on third page",
133 function () { $('#example_next').click(); },
134 function () { return document.getElementById('example_info').innerHTML == "Showing 21 to 30 of 57 entries"; }