annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/oLanguage.sInfoPostFix.js @ 9:7300ed4c1481 draft default tip

Uploaded
author saskia-hiltemann
date Mon, 04 Sep 2017 10:49:00 -0400
parents ac5f9272033b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
1 // DATA_TEMPLATE: empty_table
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
2 oTest.fnStart( "oLanguage.sInfoPostFix" );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
3
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
4 $(document).ready( function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
5 /* Check the default */
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
6 var oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
7 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
8 "bDeferRender": true
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
9 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
10 var oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
11
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
12 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
13 "Info post fix language is '' (blank) by default",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 function () { return oSettings.oLanguage.sInfoPostFix == ""; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 "Width no post fix, the basic info shows",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 "Info post fix language can be defined",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 "sInfoPostFix": "unit test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 oSettings = oTable.fnSettings();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 function () { return oSettings.oLanguage.sInfoPostFix == "unit test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 oTest.fnTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42 "Info empty language default is in the DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 "Macros have no effect in the post fix",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 "sInfoPostFix": "unit _START_ _END_ _TOTAL_ test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 function () { return document.getElementById('example_info').innerHTML = "Showing 1 to 10 of 57 entries unit _START_ _END_ _TOTAL_ test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 "Post fix is applied after fintering info",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 oTable = $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 "oLanguage": {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 "sInfoPostFix": "unit test"
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 oTable.fnFilter("nothinghere");
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 function () { return document.getElementById('example_info').innerHTML = "Showing 0 to 0 of 0 entries unit (filtered from 57 total entries) test"; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 } );