1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "fnInitComplete" );
4 /* Fairly boring function compared to the others! */
6 $(document).ready( function () {
8 "Two arguments passed",
12 $('#example').dataTable( {
14 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
15 "fnInitComplete": function ( ) {
16 mPass = arguments.length===2 && arguments[1]===undefined;
20 function () { return mPass; }
25 "That one argument is the settings object",
29 oTable = $('#example').dataTable( {
31 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
32 "fnInitComplete": function ( oSettings ) {
37 function () { console.log( oTable.fnSettings(), mPass );return oTable.fnSettings() === mPass; }
42 "fnInitComplete called once on first draw",
47 $('#example').dataTable( {
49 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
50 "fnInitComplete": function ( ) {
55 function () { return mPass == 1; }
59 "fnInitComplete never called there after",
61 $('#example_next').click();
62 $('#example_next').click();
63 $('#example_next').click();
65 function () { return mPass == 1; }
70 "10 rows in the table on complete",
75 $('#example').dataTable( {
77 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
78 "fnInitComplete": function ( ) {
79 mPass = $('#example tbody tr').length;
83 function () { return mPass == 10; }