1 // DATA_TEMPLATE: dom_data
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 var oSettings = oTable.fnSettings();
13 "Default should be null",
15 function () { return oSettings.fnInitComplete == null; }
20 "Two arguments passed",
25 $('#example').dataTable( {
26 "fnInitComplete": function ( ) {
27 mPass = arguments.length===2 && arguments[1]===undefined;
31 function () { return mPass; }
36 "That one argument is the settings object",
40 oTable = $('#example').dataTable( {
41 "fnInitComplete": function ( oSettings ) {
46 function () { return oTable.fnSettings() == mPass; }
51 "fnInitComplete called once on first draw",
56 $('#example').dataTable( {
57 "fnInitComplete": function ( ) {
62 function () { return mPass == 1; }
66 "fnInitComplete never called there after",
68 $('#example_next').click();
69 $('#example_next').click();
70 $('#example_next').click();
72 function () { return mPass == 1; }
77 "10 rows in the table on complete",
82 $('#example').dataTable( {
83 "fnInitComplete": function ( ) {
84 mPass = $('#example tbody tr').length;
88 function () { return mPass == 10; }