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",
12 var oSettings = oTable.fnSettings();
16 "Default should be null",
18 function () { return oSettings.fnInitComplete == null; }
23 "Two arguments passed (for Ajax!)",
28 $('#example').dataTable( {
29 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
31 "fnInitComplete": function ( ) {
32 mPass = arguments.length;
36 function () { return mPass == 2; }
41 "That one argument is the settings object",
45 oTable = $('#example').dataTable( {
46 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
48 "fnInitComplete": function ( oSettings ) {
53 function () { return oTable.fnSettings() == mPass; }
58 "fnInitComplete called once on first draw",
63 $('#example').dataTable( {
64 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
66 "fnInitComplete": function ( ) {
71 function () { return mPass == 1; }
75 "fnInitComplete never called there after",
77 $('#example_next').click();
78 $('#example_next').click();
79 $('#example_next').click();
81 function () { return mPass == 1; }
86 "10 rows in the table on complete",
91 $('#example').dataTable( {
92 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
94 "fnInitComplete": function ( ) {
95 mPass = $('#example tbody tr').length;
99 function () { return mPass == 10; }