/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/2_js/fnDrawCallback.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/2_js/fnDrawCallback.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: 1576 byte(s)
initial import
1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "fnDrawCallback" );
3
4 /* Fairly boring function compared to the others! */
5
6 $(document).ready( function () {
7 /* Check the default */
8 var oTable = $('#example').dataTable( {
9 "aaData": gaaData
10 } );
11 var oSettings = oTable.fnSettings();
12 var mPass;
13
14 oTest.fnTest(
15 "Default should be null",
16 null,
17 function () { return oSettings.fnDrawCallback == null; }
18 );
19
20
21 oTest.fnTest(
22 "One argument passed",
23 function () {
24 oSession.fnRestore();
25
26 mPass = -1;
27 $('#example').dataTable( {
28 "aaData": gaaData,
29 "fnDrawCallback": function ( ) {
30 mPass = arguments.length;
31 }
32 } );
33 },
34 function () { return mPass == 1; }
35 );
36
37
38 oTest.fnTest(
39 "That one argument is the settings object",
40 function () {
41 oSession.fnRestore();
42
43 oTable = $('#example').dataTable( {
44 "aaData": gaaData,
45 "fnDrawCallback": function ( oSettings ) {
46 mPass = oSettings;
47 }
48 } );
49 },
50 function () { return oTable.fnSettings() == mPass; }
51 );
52
53
54 oTest.fnTest(
55 "fnRowCallback called once on first draw",
56 function () {
57 oSession.fnRestore();
58
59 mPass = 0;
60 $('#example').dataTable( {
61 "aaData": gaaData,
62 "fnDrawCallback": function ( ) {
63 mPass++;
64 }
65 } );
66 },
67 function () { return mPass == 1; }
68 );
69
70 oTest.fnTest(
71 "fnRowCallback called once on each draw there after as well",
72 function () {
73 $('#example_next').click();
74 $('#example_next').click();
75 $('#example_next').click();
76 },
77 function () { return mPass == 4; }
78 );
79
80
81
82
83
84 oTest.fnComplete();
85 } );

  ViewVC Help
Powered by ViewVC 1.1.20