1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "oLanguage.sZeroRecords" );
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt"
9 var oSettings = oTable.fnSettings();
12 "Zero records language is 'No matching records found' by default",
14 function () { return oSettings.oLanguage.sZeroRecords == "No matching records found"; }
18 "Text is shown when empty table (after filtering)",
19 function () { oTable.fnFilter('nothinghere'); },
20 function () { return $('#example tbody tr td')[0].innerHTML == "No matching records found" }
26 "Zero records language can be defined",
29 oTable = $('#example').dataTable( {
30 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
32 "sZeroRecords": "unit test"
35 oSettings = oTable.fnSettings();
37 function () { return oSettings.oLanguage.sZeroRecords == "unit test"; }
41 "Text is shown when empty table (after filtering)",
42 function () { oTable.fnFilter('nothinghere2'); },
43 function () { return $('#example tbody tr td')[0].innerHTML == "unit test" }