1 // DATA_TEMPLATE: js_data
2 oTest.fnStart( "aoColumns.sTitle" );
4 $(document).ready( function () {
5 /* Check the default */
6 var oTable = $('#example').dataTable( {
9 var oSettings = oTable.fnSettings();
12 "If not given, then the columns titles are empty",
15 var jqNodes = $('#example thead tr:eq(0) th');
17 jqNodes[0].innerHTML == "Rendering engine" &&
18 jqNodes[1].innerHTML == "Browser" &&
19 jqNodes[2].innerHTML == "Platform(s)" &&
20 jqNodes[3].innerHTML == "Engine version" &&
21 jqNodes[4].innerHTML == "CSS grade";
27 "Can set a single column title - and others are read from DOM",
30 $('#example').dataTable( {
34 { "sTitle": 'unit test' },
42 var jqNodes = $('#example thead tr:eq(0) th');
44 jqNodes[0].innerHTML == "Rendering engine" &&
45 jqNodes[1].innerHTML == "unit test" &&
46 jqNodes[2].innerHTML == "Platform(s)" &&
47 jqNodes[3].innerHTML == "Engine version" &&
48 jqNodes[4].innerHTML == "CSS grade";
54 "Can set multiple column titles",
57 $('#example').dataTable( {
61 { "sTitle": 'unit test 1' },
64 { "sTitle": 'unit test 2' }
69 var jqNodes = $('#example thead tr:eq(0) th');
71 jqNodes[0].innerHTML == "Rendering engine" &&
72 jqNodes[1].innerHTML == "unit test 1" &&
73 jqNodes[2].innerHTML == "Platform(s)" &&
74 jqNodes[3].innerHTML == "Engine version" &&
75 jqNodes[4].innerHTML == "unit test 2";