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"
11 var oSettings = oTable.fnSettings();
15 "Default should be null",
17 function () { return oSettings.fnDrawCallback == null; }
22 "One argument passed",
28 $('#example').dataTable( {
29 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
30 "fnDrawCallback": function ( ) {
31 mPass = arguments.length;
33 "fnInitComplete": function () {
38 function () { return mPass == 1 && bInit; }
43 "That one argument is the settings object",
48 oTable = $('#example').dataTable( {
49 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
50 "fnDrawCallback": function ( oSettings ) {
53 "fnInitComplete": function () {
58 function () { return oTable.fnSettings() == mPass && bInit; }
62 /* The draw callback is called once for the init and then when the data is added */
64 "fnRowCallback called once on first draw",
70 $('#example').dataTable( {
71 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
72 "fnDrawCallback": function ( ) {
75 "fnInitComplete": function () {
80 function () { return mPass == 2 && bInit; }
84 "fnRowCallback called once on each draw there after as well",
86 $('#example_next').click();
87 $('#example_next').click();
88 $('#example_next').click();
90 function () { return mPass == 5; }