PHP Classes

File: assets/js/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js

Recommend this page to a friend!
  Classes of Tran Tuan   Pretty PHP S3 Files Manager   assets/js/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js   Download  
File: assets/js/datatables/unit_testing/tests_onhold/2_js/aoColumns.sTitle.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Pretty PHP S3 Files Manager
Web based interface to manage files in Amazon S3
Author: By
Last change:
Date: 8 years ago
Size: 1,928 bytes
 

Contents

Class file image Download
// DATA_TEMPLATE: js_data oTest.fnStart( "aoColumns.sTitle" ); $(document).ready( function () { /* Check the default */ var oTable = $('#example').dataTable( { "aaData": gaaData } ); var oSettings = oTable.fnSettings(); oTest.fnTest( "If not given, then the columns titles are empty", null, function () { var jqNodes = $('#example thead tr:eq(0) th'); var bReturn = jqNodes[0].innerHTML == "Rendering engine" && jqNodes[1].innerHTML == "Browser" && jqNodes[2].innerHTML == "Platform(s)" && jqNodes[3].innerHTML == "Engine version" && jqNodes[4].innerHTML == "CSS grade"; return bReturn; } ); oTest.fnTest( "Can set a single column title - and others are read from DOM", function () { oSession.fnRestore(); $('#example').dataTable( { "aaData": gaaData, "aoColumns": [ null, { "sTitle": 'unit test' }, null, null, null ] } ); }, function () { var jqNodes = $('#example thead tr:eq(0) th'); var bReturn = jqNodes[0].innerHTML == "Rendering engine" && jqNodes[1].innerHTML == "unit test" && jqNodes[2].innerHTML == "Platform(s)" && jqNodes[3].innerHTML == "Engine version" && jqNodes[4].innerHTML == "CSS grade"; return bReturn; } ); oTest.fnTest( "Can set multiple column titles", function () { oSession.fnRestore(); $('#example').dataTable( { "aaData": gaaData, "aoColumns": [ null, { "sTitle": 'unit test 1' }, null, null, { "sTitle": 'unit test 2' } ] } ); }, function () { var jqNodes = $('#example thead tr:eq(0) th'); var bReturn = jqNodes[0].innerHTML == "Rendering engine" && jqNodes[1].innerHTML == "unit test 1" && jqNodes[2].innerHTML == "Platform(s)" && jqNodes[3].innerHTML == "Engine version" && jqNodes[4].innerHTML == "unit test 2"; return bReturn; } ); oTest.fnComplete(); } );