/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/1_dom/fnInfoCallback.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/1_dom/fnInfoCallback.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: 2404 byte(s)
initial import
1 // DATA_TEMPLATE: dom_data
2 oTest.fnStart( "fnInfoCallback checks" );
3
4 $(document).ready( function () {
5 var mPass;
6
7 $('#example').dataTable();
8
9 /* Basic checks */
10 oTest.fnTest(
11 "null by default",
12 null,
13 function () { return $('#example').dataTable().fnSettings().oLanguage.fnInfoCallback == null; }
14 );
15
16 oTest.fnTest(
17 "Agrument length",
18 function () {
19 $('#example').dataTable( {
20 "bDestroy": true,
21 "fnInfoCallback": function( oS, iStart, iEnd, iMax, iTotal, sPre ) {
22 mPass = arguments.length;
23 return sPre;
24 }
25 } );
26 },
27 function () { return mPass == 6; }
28 );
29
30 oTest.fnTest(
31 "Settings first",
32 function () {
33 $('#example').dataTable( {
34 "bDestroy": true,
35 "fnInfoCallback": function( oS, iStart, iEnd, iMax, iTotal, sPre ) {
36 mPass = (oS == $('#example').dataTable().fnSettings()) ? true : false;
37 return sPre;
38 }
39 } );
40 },
41 function () { return mPass; }
42 );
43
44 oTest.fnTest(
45 "Start arg",
46 function () {
47 $('#example').dataTable( {
48 "bDestroy": true,
49 "fnInfoCallback": function( oS, iStart, iEnd, iMax, iTotal, sPre ) {
50 return iStart;
51 }
52 } );
53 },
54 function () { return $('#example_info').html() == "1"; }
55 );
56
57 oTest.fnTest(
58 "End arg",
59 function () {
60 $('#example').dataTable( {
61 "bDestroy": true,
62 "fnInfoCallback": function( oS, iStart, iEnd, iMax, iTotal, sPre ) {
63 return iEnd;
64 }
65 } );
66 },
67 function () { return $('#example_info').html() == "10"; }
68 );
69
70 oTest.fnTest(
71 "Max arg",
72 function () {
73 $('#example').dataTable( {
74 "bDestroy": true,
75 "fnInfoCallback": function( oS, iStart, iEnd, iMax, iTotal, sPre ) {
76 return iMax;
77 }
78 } );
79 },
80 function () { return $('#example_info').html() == "57"; }
81 );
82
83 oTest.fnTest(
84 "Max arg - filter",
85 function () {
86 $('#example').dataTable().fnFilter("1.0");
87 },
88 function () { return $('#example_info').html() == "57"; }
89 );
90
91 oTest.fnTest(
92 "Total arg",
93 function () {
94 $('#example').dataTable( {
95 "bDestroy": true,
96 "fnInfoCallback": function( oS, iStart, iEnd, iMax, iTotal, sPre ) {
97 return iTotal;
98 }
99 } );
100 },
101 function () { return $('#example_info').html() == "57"; }
102 );
103
104 oTest.fnTest(
105 "Total arg - filter",
106 function () {
107 $('#example').dataTable().fnFilter("1.0");
108 },
109 function () { return $('#example_info').html() == "3"; }
110 );
111
112
113
114 oTest.fnComplete();
115 } );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20