annotate DataTables-1.9.4/media/unit_testing/tests_onhold/6_delayed_rendering/aoColumns.sTitle.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.sTitle" );
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 "If not given, then the columns titles are empty",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
14 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
15 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
16 var jqNodes = $('#example thead tr:eq(0) th');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
17 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
18 jqNodes[0].innerHTML == "Rendering engine" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
19 jqNodes[1].innerHTML == "Browser" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
20 jqNodes[2].innerHTML == "Platform(s)" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
21 jqNodes[3].innerHTML == "Engine version" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
22 jqNodes[4].innerHTML == "CSS grade";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
23 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
24 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
25 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
26
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
27 oTest.fnWaitTest(
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
28 "Can set a single column title - and others are read from DOM",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
29 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
30 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
31 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
32 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
33 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
34 "aoColumns": [
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
35 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
36 { "sTitle": 'unit test' },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
37 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
38 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
39 null
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
40 ]
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 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
44 var jqNodes = $('#example thead tr:eq(0) th');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
45 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
46 jqNodes[0].innerHTML == "Rendering engine" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
47 jqNodes[1].innerHTML == "unit test" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
48 jqNodes[2].innerHTML == "Platform(s)" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
49 jqNodes[3].innerHTML == "Engine version" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
50 jqNodes[4].innerHTML == "CSS grade";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
51 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
52 }
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 "Can set multiple column titles",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
57 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
58 oSession.fnRestore();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
59 $('#example').dataTable( {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
60 "sAjaxSource": "../../../examples/ajax/sources/arrays.txt",
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
61 "bDeferRender": true,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
62 "aoColumns": [
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
63 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
64 { "sTitle": 'unit test 1' },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
65 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
66 null,
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
67 { "sTitle": 'unit test 2' }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
68 ]
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
69 } );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
70 },
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
71 function () {
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
72 var jqNodes = $('#example thead tr:eq(0) th');
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
73 var bReturn =
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
74 jqNodes[0].innerHTML == "Rendering engine" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
75 jqNodes[1].innerHTML == "unit test 1" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
76 jqNodes[2].innerHTML == "Platform(s)" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
77 jqNodes[3].innerHTML == "Engine version" &&
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
78 jqNodes[4].innerHTML == "unit test 2";
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
79 return bReturn;
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
80 }
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
81 );
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
82
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
83
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
84 oTest.fnComplete();
ac5f9272033b first upload
saskia-hiltemann
parents:
diff changeset
85 } );