1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "oLanguage.sZeroRecords" );
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
8 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
10 var oSettings = oTable.fnSettings();
13 "Zero records language is 'No matching records found' by default",
15 function () { return oSettings.oLanguage.sZeroRecords == "No matching records found"; }
19 "Text is shown when empty table (after filtering)",
20 function () { oTable.fnFilter('nothinghere'); },
22 if ( $('#example tbody tr td').length == 0 )
24 return $('#example tbody tr td')[0].innerHTML == "No matching records found";
31 "Zero records language can be defined",
34 oTable = $('#example').dataTable( {
36 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
38 "sZeroRecords": "unit test"
41 oSettings = oTable.fnSettings();
43 function () { return oSettings.oLanguage.sZeroRecords == "unit test"; }
47 "Text is shown when empty table (after filtering)",
48 function () { oTable.fnFilter('nothinghere2'); },
50 if ( $('#example tbody tr td').length == 0 )
52 return $('#example tbody tr td')[0].innerHTML == "unit test"