/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/4_server-side/oLanguage.sZeroRecords.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/4_server-side/oLanguage.sZeroRecords.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2125 - (show annotations) (download) (as text)
Wed Mar 12 19:30:05 2014 UTC (10 years, 3 months ago) by torben
File MIME type: application/javascript
File size: 1557 byte(s)
initial import
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "oLanguage.sZeroRecords" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "bServerSide": true,
8 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php"
9 } );
10 var oSettings = oTable.fnSettings();
11
12 oTest.fnWaitTest(
13 "Zero records language is 'No matching records found' by default",
14 null,
15 function () { return oSettings.oLanguage.sZeroRecords == "No matching records found"; }
16 );
17
18 oTest.fnWaitTest(
19 "Text is shown when empty table (after filtering)",
20 function () { oTable.fnFilter('nothinghere'); },
21 function () {
22 if ( $('#example tbody tr td').length == 0 )
23 return false;
24 return $('#example tbody tr td')[0].innerHTML == "No matching records found";
25 }
26 );
27
28
29
30 oTest.fnWaitTest(
31 "Zero records language can be defined",
32 function () {
33 oSession.fnRestore();
34 oTable = $('#example').dataTable( {
35 "bServerSide": true,
36 "sAjaxSource": "../../../examples/server_side/scripts/server_processing.php",
37 "oLanguage": {
38 "sZeroRecords": "unit test"
39 }
40 } );
41 oSettings = oTable.fnSettings();
42 },
43 function () { return oSettings.oLanguage.sZeroRecords == "unit test"; }
44 );
45
46 oTest.fnWaitTest(
47 "Text is shown when empty table (after filtering)",
48 function () { oTable.fnFilter('nothinghere2'); },
49 function () {
50 if ( $('#example tbody tr td').length == 0 )
51 return false;
52 return $('#example tbody tr td')[0].innerHTML == "unit test"
53 }
54 );
55
56
57 oTest.fnComplete();
58 } );

  ViewVC Help
Powered by ViewVC 1.1.20