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