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"
15 var oSettings = oTable.fnSettings();
18 "Processing is off by default",
20 function () { return oSettings.oFeatures.bProcessing == false; }
24 "Processing div is not in the DOM",
25 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
26 function () { return document.getElementById('example_processing') == null; }
30 "Processing div cannot be shown",
31 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
32 function () { return document.getElementById('example_processing') == null; }
36 "Processing div cannot be hidden",
37 function () { oTable.oApi._fnProcessingDisplay( oSettings, false ); },
38 function () { return document.getElementById('example_processing') == null; }
42 /* Check can disable */
44 "Processing can be enabled",
47 oTable = $('#example').dataTable( {
48 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
51 oSettings = oTable.fnSettings();
53 function () { return oSettings.oFeatures.bProcessing == true; }
57 "Processing div is in the DOM",
58 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
59 function () { return document.getElementById('example_processing'); }
63 "Processing div is hidden by default",
64 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
65 function () { return document.getElementById('example_processing').style.visibility = "hidden"; }
69 "Processing div can be shown",
70 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
71 function () { return document.getElementById('example_processing').style.visibility = "visible"; }
75 "Processing div can be hidden",
76 function () { oTable.oApi._fnProcessingDisplay( oSettings, false ); },
77 function () { return document.getElementById('example_processing').style.visibility = "hidden"; }
80 /* Enable makes no difference */
82 "Processing disabled override",
85 oTable = $('#example').dataTable( {
86 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
89 oSettings = oTable.fnSettings();
91 function () { return oSettings.oFeatures.bProcessing == false; }
95 "Processing div is not in the DOM",
96 function () { oTable.oApi._fnProcessingDisplay( oSettings, true ); },
97 function () { return document.getElementById('example_processing') == null; }