Add datatables-1.9.4 and jquery-1.10.2 libraries
[proteocache.git] / webapp / resources / datatables-1.9.4 / media / unit_testing / tests_onhold / 6_delayed_rendering / aoColumns.sClass.js
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aoColumns.sClass" );
3
4 $(document).ready( function () {
5         /* Check the default */
6         var oTable = $('#example').dataTable( {
7                 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
8                 "bDeferRender": true
9         } );
10         var oSettings = oTable.fnSettings();
11         
12         oTest.fnWaitTest( 
13                 "By default the test class hasn't been applied to the column (sanity!)",
14                 null,
15                 function () { return $('#example tbody tr:eq(0) td:eq(2)').hasClass('unittest') == false; }
16         );
17         
18         oTest.fnWaitTest( 
19                 "Add a class to a single column - first row",
20                 function () {
21                         oSession.fnRestore();
22                         $('#example').dataTable( {
23                                 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
24                                 "bDeferRender": true,
25                                 "aoColumns": [
26                                         null,
27                                         null,
28                                         { "sClass": 'unittest' },
29                                         null,
30                                         null
31                                 ]
32                         } );
33                 },
34                 function () { return $('#example tbody tr:eq(1) td:eq(2)').hasClass('unittest'); }
35         );
36         
37         oTest.fnWaitTest( 
38                 "Add a class to a single column - third row",
39                 null,
40                 function () { return $('#example tbody tr:eq(3) td:eq(2)').hasClass('unittest'); }
41         );
42         
43         oTest.fnWaitTest( 
44                 "Add a class to a single column - last row",
45                 null,
46                 function () { return $('#example tbody tr:eq(9) td:eq(2)').hasClass('unittest'); }
47         );
48         
49         oTest.fnWaitTest( 
50                 "Add a class to a single column - has not applied to other columns - 1st",
51                 null,
52                 function () { return $('#example tbody tr:eq(3) td:eq(0)').hasClass('unittest') == false; }
53         );
54         
55         oTest.fnWaitTest( 
56                 "Add a class to a single column - has not applied to other columns - 5th",
57                 null,
58                 function () { return $('#example tbody tr:eq(3) td:eq(4)').hasClass('unittest') == false; }
59         );
60         
61         oTest.fnWaitTest( 
62                 "Add a class to a single column - seventh row - second page",
63                 function () { $('#example_next').click(); },
64                 function () { return $('#example tbody tr:eq(6) td:eq(2)').hasClass('unittest'); }
65         );
66         
67         oTest.fnWaitTest( 
68                 "Add a class to a single column - has not applied to header",
69                 null,
70                 function () { return $('#example thead tr:eq(3) th:eq(4)').hasClass('unittest') == false; }
71         );
72         
73         oTest.fnWaitTest( 
74                 "Add a class to a single column - has not applied to footer",
75                 null,
76                 function () { return $('#example thead tr:eq(3) th:eq(4)').hasClass('unittest') == false; }
77         );
78         
79         
80         oTest.fnWaitTest( 
81                 "Class defined for multiple columns - first row",
82                 function () {
83                         oSession.fnRestore();
84                         $('#example').dataTable( {
85                                 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
86                                 "bDeferRender": true,
87                                 "aoColumns": [
88                                         { "sClass": 'unittest2' },
89                                         null,
90                                         null,
91                                         { "sClass": 'unittest1' },
92                                         null
93                                 ]
94                         } );
95                 },
96                 function () {
97                         var bReturn = 
98                                 $('#example tbody tr:eq(3) td:eq(0)').hasClass('unittest2') &&
99                                 $('#example tbody tr:eq(8) td:eq(3)').hasClass('unittest1');
100                         return bReturn;
101                 }
102         );
103         
104         oTest.fnWaitTest( 
105                 "Class defined for multiple columns - has not applied to other columns - 5th 1",
106                 null,
107                 function () { return $('#example tbody tr:eq(0) td:eq(4)').hasClass('unittest1') == false; }
108         );
109         
110         oTest.fnWaitTest( 
111                 "Class defined for multiple columns - has not applied to other columns - 5th 2",
112                 null,
113                 function () { return $('#example tbody tr:eq(6) td:eq(4)').hasClass('unittest2') == false; }
114         );
115         
116         
117         oTest.fnComplete();
118 } );