Debian Codegraph @

old-tests/tests_onhold/7_api/selectors-deferRender.js

raw
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "API selectors with deferRender enabled" );
3
4
5 $(document).ready( function () {
6 var table = $('#example').DataTable( {
7 deferRender: true,
8 ajax: "../../../examples/ajax/data/arrays.txt"
9 } );
10
11 oTest.fnWaitTest(
12 "rows().nodes(), no selector, returns 10 nodes",
13 null,
14 function () { return table.rows().nodes().length === 10; }
15 );
16
17 oTest.fnTest(
18 "rows().nodes(), class defined selector, returns 5 nodes",
19 null,
20 function () { return table.rows('.odd').nodes().length === 5; }
21 );
22
23 oTest.fnTest(
24 "rows().nodes(), class not defined selector, returns 0 nodes",
25 null,
26 function () { return table.rows('.nothere').nodes().length === 0; }
27 );
28
29
30 oTest.fnTest(
31 "column(0).nodes(), returns 10 nodes",
32 null,
33 function () { return table.column(0).nodes().length === 10; }
34 );
35
36
37 oTest.fnTest(
38 "cells().nodes(), no selector, returns 60 nodes",
39 null,
40 function () { return table.cells().nodes().length === 60; }
41 );
42
43 oTest.fnTest(
44 "cells().nodes(), class defined selector, returns 0 nodes",
45 null,
46 function () { return table.cells('.sorting_1').nodes().length === 10; }
47 );
48
49 oTest.fnTest(
50 "cells().nodes(), class not defined selector, returns 0 nodes",
51 null,
52 function () { return table.cells('.nothere').nodes().length === 0; }
53 );
54
55
56 oTest.fnComplete();
57 } );