1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "fnDrawCallback" );
4 /* Fairly boring function compared to the others! */
6 $(document).ready( function () {
7 /* Check the default */
8 var oTable = $('#example').dataTable( {
9 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
12 var oSettings = oTable.fnSettings();
16 "Default should be null",
18 function () { return oSettings.fnDrawCallback == null; }
23 "One argument passed",
29 $('#example').dataTable( {
30 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
32 "fnDrawCallback": function ( ) {
33 mPass = arguments.length;
35 "fnInitComplete": function () {
40 function () { return mPass == 1 && bInit; }
45 "That one argument is the settings object",
50 oTable = $('#example').dataTable( {
51 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
53 "fnDrawCallback": function ( oSettings ) {
56 "fnInitComplete": function () {
61 function () { return oTable.fnSettings() == mPass && bInit; }
65 /* The draw callback is called once for the init and then when the data is added */
67 "fnRowCallback called once on first draw",
73 $('#example').dataTable( {
74 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
76 "fnDrawCallback": function ( ) {
79 "fnInitComplete": function () {
84 function () { return mPass == 2 && bInit; }
88 "fnRowCallback called once on each draw there after as well",
90 $('#example_next').click();
91 $('#example_next').click();
92 $('#example_next').click();
94 function () { return mPass == 5; }