Debian Codegraph @

old-tests/tests_onhold/2_js/8549--string-sorting-nonstrings.js

raw
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "8549 - string sorting non-string types" );
3
4 $(document).ready( function () {
5 var test = false;
6
7 $.fn.dataTable.ext.sErrMode = "throw";
8
9
10
11 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
12 * Shallow properties
13 */
14
15 $('#example').dataTable( {
16 "aaData": [
17 [ null ],
18 [ 5 ],
19 [ "1a" ],
20 [ new Date(0) ]
21 ],
22 "aoColumns": [
23 { "sTitle": "Test" }
24 ]
25 } );
26
27 oTest.fnTest(
28 "Sorting works - first cell is empty",
29 null,
30 function () { return $('#example tbody tr:eq(0) td:eq(0)').html() === ""; }
31 );
32
33 oTest.fnTest(
34 "Second cell is 1a",
35 null,
36 function () { return $('#example tbody tr:eq(1) td:eq(0)').html() === "1a"; }
37 );
38
39 oTest.fnTest(
40 "Third cell is 5",
41 null,
42 function () { return $('#example tbody tr:eq(2) td:eq(0)').html() === "5"; }
43 );
44
45
46 oTest.fnComplete();
47 } );