annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/aoColumns.sClass.js @ 0:ac5f9272033b draft

first upload
author saskia-hiltemann
date Tue, 01 Jul 2014 11:42:23 -0400
parents
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( "aoColumns.sClass" );
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 "By default the test class hasn't been applied to the column (sanity!)",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 function () { return $('#example tbody tr:eq(0) td:eq(2)').hasClass('unittest') == false; }
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.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 "Add a class to a single column - first row",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 "aoColumns": [
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 { "sClass": 'unittest' },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 null
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 ]
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 function () { return $('#example tbody tr:eq(1) td:eq(2)').hasClass('unittest'); }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 "Add a class to a single column - third row",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 function () { return $('#example tbody tr:eq(3) td:eq(2)').hasClass('unittest'); }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
41 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
42
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
43 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 "Add a class to a single column - last row",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 function () { return $('#example tbody tr:eq(9) td:eq(2)').hasClass('unittest'); }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 "Add a class to a single column - has not applied to other columns - 1st",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 function () { return $('#example tbody tr:eq(3) td:eq(0)').hasClass('unittest') == false; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
53 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
54
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
55 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
56 "Add a class to a single column - has not applied to other columns - 5th",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 function () { return $('#example tbody tr:eq(3) td:eq(4)').hasClass('unittest') == false; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 "Add a class to a single column - seventh row - second page",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 function () { $('#example_next').click(); },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 function () { return $('#example tbody tr:eq(6) td:eq(2)').hasClass('unittest'); }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 "Add a class to a single column - has not applied to header",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 function () { return $('#example thead tr:eq(3) th:eq(4)').hasClass('unittest') == false; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 "Add a class to a single column - has not applied to footer",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 function () { return $('#example thead tr:eq(3) th:eq(4)').hasClass('unittest') == false; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 );
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 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 "Class defined for multiple columns - first row",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
84 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
85 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
86 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
87 "aoColumns": [
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
88 { "sClass": 'unittest2' },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
89 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
90 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
91 { "sClass": 'unittest1' },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
92 null
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
93 ]
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
94 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
95 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
96 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
97 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
98 $('#example tbody tr:eq(3) td:eq(0)').hasClass('unittest2') &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
99 $('#example tbody tr:eq(8) td:eq(3)').hasClass('unittest1');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
100 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
101 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
102 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
103
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
104 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
105 "Class defined for multiple columns - has not applied to other columns - 5th 1",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
106 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
107 function () { return $('#example tbody tr:eq(0) td:eq(4)').hasClass('unittest1') == false; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
108 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
109
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
110 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
111 "Class defined for multiple columns - has not applied to other columns - 5th 2",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
112 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
113 function () { return $('#example tbody tr:eq(6) td:eq(4)').hasClass('unittest2') == false; }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
114 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
115
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
116
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
117 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
118 } );