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/objects.txt",
10 { "mData": "browser" },
11 { "mData": "platform" },
12 { "mData": "version" },
16 var oSettings = oTable.fnSettings();
19 "Zero records language is 'No matching records found' by default",
21 function () { return oSettings.oLanguage.sZeroRecords == "No matching records found"; }
25 "Text is shown when empty table (after filtering)",
26 function () { oTable.fnFilter('nothinghere'); },
27 function () { return $('#example tbody tr td')[0].innerHTML == "No matching records found" }
33 "Zero records language can be defined",
36 oTable = $('#example').dataTable( {
37 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
39 { "mData": "engine", "aTargets": [0] },
40 { "mData": "browser", "aTargets": [1] },
41 { "mData": "platform", "aTargets": [2] },
42 { "mData": "version", "aTargets": [3] },
43 { "mData": "grade", "aTargets": [4] }
46 "sZeroRecords": "unit test"
49 oSettings = oTable.fnSettings();
51 function () { return oSettings.oLanguage.sZeroRecords == "unit test"; }
55 "Text is shown when empty table (after filtering)",
56 function () { oTable.fnFilter('nothinghere2'); },
57 function () { return $('#example tbody tr td')[0].innerHTML == "unit test" }