/[projects]/misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/aoColumns.sTitle.js
ViewVC logotype

Contents of /misc/horsensspejder-web/jquery/DataTables-1.9.4/media/unit_testing/tests_onhold/5_ajax_objects/aoColumns.sTitle.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: 2406 byte(s)
initial import
1 // DATA_TEMPLATE: empty_table
2 oTest.fnStart( "aoColumns.sTitle" );
3
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
7 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
8 "aoColumns": [
9 { "mData": "engine" },
10 { "mData": "browser" },
11 { "mData": "platform" },
12 { "mData": "version" },
13 { "mData": "grade" }
14 ]
15 } );
16 var oSettings = oTable.fnSettings();
17
18 oTest.fnWaitTest(
19 "If not given, then the columns titles are empty",
20 null,
21 function () {
22 var jqNodes = $('#example thead tr:eq(0) th');
23 var bReturn =
24 jqNodes[0].innerHTML == "Rendering engine" &&
25 jqNodes[1].innerHTML == "Browser" &&
26 jqNodes[2].innerHTML == "Platform(s)" &&
27 jqNodes[3].innerHTML == "Engine version" &&
28 jqNodes[4].innerHTML == "CSS grade";
29 return bReturn;
30 }
31 );
32
33 oTest.fnWaitTest(
34 "Can set a single column title - and others are read from DOM",
35 function () {
36 oSession.fnRestore();
37 $('#example').dataTable( {
38 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
39 "aoColumns": [
40 { "mData": "engine" },
41 { "mData": "browser", "sTitle": 'unit test' },
42 { "mData": "platform" },
43 { "mData": "version" },
44 { "mData": "grade" }
45 ]
46 } );
47 },
48 function () {
49 var jqNodes = $('#example thead tr:eq(0) th');
50 var bReturn =
51 jqNodes[0].innerHTML == "Rendering engine" &&
52 jqNodes[1].innerHTML == "unit test" &&
53 jqNodes[2].innerHTML == "Platform(s)" &&
54 jqNodes[3].innerHTML == "Engine version" &&
55 jqNodes[4].innerHTML == "CSS grade";
56 return bReturn;
57 }
58 );
59
60 oTest.fnWaitTest(
61 "Can set multiple column titles",
62 function () {
63 oSession.fnRestore();
64 $('#example').dataTable( {
65 "sAjaxSource": "../../../examples/ajax/sources/objects.txt",
66 "aoColumns": [
67 { "mData": "engine" },
68 { "mData": "browser", "sTitle": 'unit test 1' },
69 { "mData": "platform" },
70 { "mData": "version" },
71 { "mData": "grade", "sTitle": 'unit test 2' }
72 ]
73 } );
74 },
75 function () {
76 var jqNodes = $('#example thead tr:eq(0) th');
77 var bReturn =
78 jqNodes[0].innerHTML == "Rendering engine" &&
79 jqNodes[1].innerHTML == "unit test 1" &&
80 jqNodes[2].innerHTML == "Platform(s)" &&
81 jqNodes[3].innerHTML == "Engine version" &&
82 jqNodes[4].innerHTML == "unit test 2";
83 return bReturn;
84 }
85 );
86
87
88 oTest.fnComplete();
89 } );

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20