1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "bProcessing" );
4 /* It's actually a bit hard to set this one due to the fact that it will only be shown
5 * when DataTables is doing some kind of processing. The server-side processing is a bit
6 * better to test this than here - so we just the interal functions to enable it and check
10 $(document).ready( function () {
11 /* Check the default */
12 var oTable = $('#example').dataTable( {
13 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
16 var oSettings = oTable.fnSettings();
19 "Processing is off by default",
21 function () { return oSettings.oFeatures.bProcessing == false; }
25 "Processing div is not in the DOM",
26 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
27 function () { return document.getElementById('example_processing') == null; }
31 "Processing div cannot be shown",
32 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
33 function () { return document.getElementById('example_processing') == null; }
37 "Processing div cannot be hidden",
38 function () { oTable.oApi._fnProcessingDisplay( oSettings, false ); },
39 function () { return document.getElementById('example_processing') == null; }
43 /* Check can disable */
45 "Processing can be enabled",
48 oTable = $('#example').dataTable( {
49 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
53 oSettings = oTable.fnSettings();
55 function () { return oSettings.oFeatures.bProcessing == true; }
59 "Processing div is in the DOM",
60 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
61 function () { return document.getElementById('example_processing'); }
65 "Processing div is hidden by default",
66 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
67 function () { return document.getElementById('example_processing').style.visibility = "hidden"; }
71 "Processing div can be shown",
72 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
73 function () { return document.getElementById('example_processing').style.visibility = "visible"; }
77 "Processing div can be hidden",
78 function () { oTable.oApi._fnProcessingDisplay( oSettings, false ); },
79 function () { return document.getElementById('example_processing').style.visibility = "hidden"; }
82 /* Enable makes no difference */
84 "Processing disabled override",
87 oTable = $('#example').dataTable( {
88 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
92 oSettings = oTable.fnSettings();
94 function () { return oSettings.oFeatures.bProcessing == false; }
98 "Processing div is not in the DOM",
99 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
100 function () { return document.getElementById('example_processing') == null; }