1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "fnInitComplete" );
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.fnInitComplete == null; }
22 "Two arguments passed (for Ajax!)",
27 $('#example').dataTable( {
28 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
29 "fnInitComplete": function ( ) {
30 mPass = arguments.length;
34 function () { return mPass == 2; }
39 "That one argument is the settings object",
43 oTable = $('#example').dataTable( {
44 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
45 "fnInitComplete": function ( oSettings ) {
50 function () { return oTable.fnSettings() == mPass; }
55 "fnInitComplete called once on first draw",
60 $('#example').dataTable( {
61 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
62 "fnInitComplete": function ( ) {
67 function () { return mPass == 1; }
71 "fnInitComplete never called there after",
73 $('#example_next').click();
74 $('#example_next').click();
75 $('#example_next').click();
77 function () { return mPass == 1; }
82 "10 rows in the table on complete",
87 $('#example').dataTable( {
88 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
89 "fnInitComplete": function ( ) {
90 mPass = $('#example tbody tr').length;
94 function () { return mPass == 10; }