mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-19 17:54:14 +01:00
New: Unit tests for column visibility with complex headers and fnSetColumnVis
This commit is contained in:
parent
7c4958ee60
commit
a6c8a13e6a
@ -19,11 +19,11 @@
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable( {
|
||||
"sScrollY": "300px",
|
||||
"bPaginate": false,
|
||||
"aoColumnDefs": [
|
||||
{ "bVisible": false, "aTargets": [3] },
|
||||
{ "sWidth": "50%", "aTargets": [2] }
|
||||
]
|
||||
"bPaginate": false//,
|
||||
//"aoColumnDefs": [
|
||||
// { "bVisible": false, "aTargets": [3] },
|
||||
// { "sWidth": "50%", "aTargets": [2] }
|
||||
//]
|
||||
} );
|
||||
//$('#example').dataTable().fnSetColumnVis( 1, false );
|
||||
//$('#example').dataTable().fnSetColumnVis( 1, true );
|
||||
@ -44,61 +44,42 @@
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="bl bt">Rendering engine</th>
|
||||
<th colspan="3" rowspan="2" class="bl br bt">Browser details</th>
|
||||
<th class="br bt">CSS grade</th>
|
||||
<th class="bl bt">1</th>
|
||||
<th colspan="3" rowspan="2" class="bl br bt">2</th>
|
||||
<th class="br bt">3</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" rowspan="3">1</th>
|
||||
<td class="bl br">3</td>
|
||||
<th class="bl br" rowspan="3">4</th>
|
||||
<td class="bl br">5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" colspan="2">Browser</th>
|
||||
<th class="br" rowspan="3">Engine version</th>
|
||||
<th class="br bt" rowspan="3">CSS grade</th>
|
||||
<th class="bl br" colspan="2">6</th>
|
||||
<th class="br" rowspan="3">7</th>
|
||||
<th class="br bt" rowspan="3">8</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br">Browser</th>
|
||||
<th class="bl br">Platform(s)</th>
|
||||
<th class="bl br">9</th>
|
||||
<th class="bl br">10</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" colspan="2">2</th>
|
||||
<th class="bl br">Platform(s)</th>
|
||||
<th class="bl br" colspan="2">11</th>
|
||||
<th class="bl br">12</th>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<th>Rendering engine</th>
|
||||
<th>Browser</th>
|
||||
<th>Engine version</th>
|
||||
<th>CSS grade</th>
|
||||
<th>Market share</th>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th rowspan="2" class="bl bt">Rendering engine</th>
|
||||
<th colspan="3" class="bl br bt">Browser details</th>
|
||||
<th rowspan="2" class="br bt">CSS grade</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl">Browser</th>
|
||||
<th>Platform(s)</th>
|
||||
<th class="br">Engine version</th>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th rowspan="2">Rendering engine</th>
|
||||
<th>Browser</th>
|
||||
<th>Platform(s)</th>
|
||||
<th>Engine version</th>
|
||||
<th rowspan="2">CSS grade</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="3">Browser details</th>
|
||||
</tr>
|
||||
-->
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="bl bt">1</th>
|
||||
<th colspan="3" rowspan="2" class="bl br bt">2</th>
|
||||
<th class="br bt">3</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br">4</th>
|
||||
<th class="bl br">5</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" colspan="5">6</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr class="gradeX">
|
||||
<td>Trident</td>
|
||||
@ -504,17 +485,6 @@
|
||||
<td class="center">U</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="bl bt">Rendering engine</th>
|
||||
<th colspan="3" rowspan="2" class="bl br bt">Browser details</th>
|
||||
<th class="br bt">CSS grade</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br">1</th>
|
||||
<th class="bl br">3</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
|
485
media/unit_testing/templates/complex_header_2.php
Normal file
485
media/unit_testing/templates/complex_header_2.php
Normal file
@ -0,0 +1,485 @@
|
||||
<?php
|
||||
header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
|
||||
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
|
||||
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
||||
header( 'Cache-Control: post-check=0, pre-check=0', false );
|
||||
header( 'Pragma: no-cache' );
|
||||
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico" />
|
||||
|
||||
<title>DataTables unit testing</title>
|
||||
<style type="text/css" title="currentStyle">
|
||||
@import "../../css/demo_page.css";
|
||||
@import "../../css/demo_table.css";
|
||||
</style>
|
||||
<script type="text/javascript" language="javascript" src="../../js/jquery.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="../../js/jquery.dataTables.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="../unit_test.js"></script>
|
||||
<?php
|
||||
$aScripts = explode( ":", $_GET['scripts'] );
|
||||
for ( $i=0 ; $i<count($aScripts) ; $i++ )
|
||||
{
|
||||
echo '<script type="text/javascript" language="javascript" src="../'.$aScripts[$i].'?rand='.rand().'"></script>'."\n";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body id="dt_example">
|
||||
<div id="container">
|
||||
<div class="full_width big">
|
||||
<i>DataTables</i> unit test template for reading DOM data
|
||||
</div>
|
||||
|
||||
<div id="demo">
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="bl bt">1</th>
|
||||
<th colspan="3" rowspan="2" class="bl br bt">2</th>
|
||||
<th class="br bt">3</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" rowspan="3">4</th>
|
||||
<td class="bl br">5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" colspan="2">6</th>
|
||||
<th class="br" rowspan="3">7</th>
|
||||
<th class="br bt" rowspan="3">8</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br">9</th>
|
||||
<th class="bl br">10</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" colspan="2">11</th>
|
||||
<th class="bl br">12</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="bl bt">1</th>
|
||||
<th colspan="3" rowspan="2" class="bl br bt">2</th>
|
||||
<th class="br bt">3</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br">4</th>
|
||||
<th class="bl br">5</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="bl br" colspan="5">6</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<tr class="gradeX">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 4.0</td>
|
||||
<td>Win 95+</td>
|
||||
<td class="center">4</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 5.0</td>
|
||||
<td>Win 95+</td>
|
||||
<td class="center">5</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 5.5</td>
|
||||
<td>Win 95+</td>
|
||||
<td class="center">5.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 6</td>
|
||||
<td>Win 98+</td>
|
||||
<td class="center">6</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>Internet Explorer 7</td>
|
||||
<td>Win XP SP2+</td>
|
||||
<td class="center">7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>AOL browser (AOL desktop)</td>
|
||||
<td>Win XP</td>
|
||||
<td class="center">6</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 1.0</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 1.5</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 2.0</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 3.0</td>
|
||||
<td>Win 2k+ / OSX.3+</td>
|
||||
<td class="center">1.9</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Camino 1.0</td>
|
||||
<td>OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Camino 1.5</td>
|
||||
<td>OSX.3+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Netscape 7.2</td>
|
||||
<td>Win 95+ / Mac OS 8.6-9.2</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Netscape Browser 8</td>
|
||||
<td>Win 98SE+</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Netscape Navigator 9</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.0</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.1</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.2</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.2</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.3</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.3</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.4</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.4</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.5</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.6</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.6</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.7</td>
|
||||
<td>Win 98+ / OSX.1+</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.8</td>
|
||||
<td>Win 98+ / OSX.1+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Seamonkey 1.1</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Epiphany 2.20</td>
|
||||
<td>Gnome</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 1.2</td>
|
||||
<td>OSX.3</td>
|
||||
<td class="center">125.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 1.3</td>
|
||||
<td>OSX.3</td>
|
||||
<td class="center">312.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 2.0</td>
|
||||
<td>OSX.4+</td>
|
||||
<td class="center">419.3</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 3.0</td>
|
||||
<td>OSX.4+</td>
|
||||
<td class="center">522.1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>OmniWeb 5.5</td>
|
||||
<td>OSX.4+</td>
|
||||
<td class="center">420</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>iPod Touch / iPhone</td>
|
||||
<td>iPod</td>
|
||||
<td class="center">420.1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>S60</td>
|
||||
<td>S60</td>
|
||||
<td class="center">413</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 7.0</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 7.5</td>
|
||||
<td>Win 95+ / OSX.2+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 8.0</td>
|
||||
<td>Win 95+ / OSX.2+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 8.5</td>
|
||||
<td>Win 95+ / OSX.2+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 9.0</td>
|
||||
<td>Win 95+ / OSX.3+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 9.2</td>
|
||||
<td>Win 88+ / OSX.3+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 9.5</td>
|
||||
<td>Win 88+ / OSX.3+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera for Wii</td>
|
||||
<td>Wii</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Nokia N800</td>
|
||||
<td>N800</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Nintendo DS browser</td>
|
||||
<td>Nintendo DS</td>
|
||||
<td class="center">8.5</td>
|
||||
<td class="center">C/A<sup>1</sup></td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>KHTML</td>
|
||||
<td>Konqureror 3.1</td>
|
||||
<td>KDE 3.1</td>
|
||||
<td class="center">3.1</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>KHTML</td>
|
||||
<td>Konqureror 3.3</td>
|
||||
<td>KDE 3.3</td>
|
||||
<td class="center">3.3</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>KHTML</td>
|
||||
<td>Konqureror 3.5</td>
|
||||
<td>KDE 3.5</td>
|
||||
<td class="center">3.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Tasman</td>
|
||||
<td>Internet Explorer 4.5</td>
|
||||
<td>Mac OS 8-9</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Tasman</td>
|
||||
<td>Internet Explorer 5.1</td>
|
||||
<td>Mac OS 7.6-9</td>
|
||||
<td class="center">1</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Tasman</td>
|
||||
<td>Internet Explorer 5.2</td>
|
||||
<td>Mac OS 8-X</td>
|
||||
<td class="center">1</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Misc</td>
|
||||
<td>NetFront 3.1</td>
|
||||
<td>Embedded devices</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Misc</td>
|
||||
<td>NetFront 3.4</td>
|
||||
<td>Embedded devices</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Misc</td>
|
||||
<td>Dillo 0.8</td>
|
||||
<td>Embedded devices</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Misc</td>
|
||||
<td>Links</td>
|
||||
<td>Text only</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Misc</td>
|
||||
<td>Lynx</td>
|
||||
<td>Text only</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Misc</td>
|
||||
<td>IE Mobile</td>
|
||||
<td>Windows Mobile 6</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Misc</td>
|
||||
<td>PSP browser</td>
|
||||
<td>PSP</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeU">
|
||||
<td>Other browsers</td>
|
||||
<td>All others</td>
|
||||
<td>-</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">U</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
472
media/unit_testing/templates/dom_data_two_headers.php
Normal file
472
media/unit_testing/templates/dom_data_two_headers.php
Normal file
@ -0,0 +1,472 @@
|
||||
<?php
|
||||
header( 'Expires: Sat, 26 Jul 1997 05:00:00 GMT' );
|
||||
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
|
||||
header( 'Cache-Control: no-store, no-cache, must-revalidate' );
|
||||
header( 'Cache-Control: post-check=0, pre-check=0', false );
|
||||
header( 'Pragma: no-cache' );
|
||||
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||
<link rel="shortcut icon" type="image/ico" href="http://www.sprymedia.co.uk/media/images/favicon.ico" />
|
||||
|
||||
<title>DataTables unit testing</title>
|
||||
<style type="text/css" title="currentStyle">
|
||||
@import "../../css/demo_page.css";
|
||||
@import "../../css/demo_table.css";
|
||||
</style>
|
||||
<script type="text/javascript" language="javascript" src="../../js/jquery.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="../../js/jquery.dataTables.js"></script>
|
||||
<script type="text/javascript" language="javascript" src="../unit_test.js"></script>
|
||||
<?php
|
||||
$aScripts = explode( ":", $_GET['scripts'] );
|
||||
for ( $i=0 ; $i<count($aScripts) ; $i++ )
|
||||
{
|
||||
echo '<script type="text/javascript" language="javascript" src="../'.$aScripts[$i].'?rand='.rand().'"></script>'."\n";
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body id="dt_example">
|
||||
<div id="container">
|
||||
<div class="full_width big">
|
||||
<i>DataTables</i> unit test template for reading DOM data - with two rows in header
|
||||
</div>
|
||||
|
||||
<div id="demo">
|
||||
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Rendering engine</th>
|
||||
<th>Browser</th>
|
||||
<th>Platform(s)</th>
|
||||
<th>Engine version</th>
|
||||
<th>CSS grade</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Rendering engine</th>
|
||||
<th>Browser</th>
|
||||
<th>Platform(s)</th>
|
||||
<th>Engine version</th>
|
||||
<th>CSS grade</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr class="gradeX">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 4.0</td>
|
||||
<td>Win 95+</td>
|
||||
<td class="center">4</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 5.0</td>
|
||||
<td>Win 95+</td>
|
||||
<td class="center">5</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 5.5</td>
|
||||
<td>Win 95+</td>
|
||||
<td class="center">5.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>Internet
|
||||
Explorer 6</td>
|
||||
<td>Win 98+</td>
|
||||
<td class="center">6</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>Internet Explorer 7</td>
|
||||
<td>Win XP SP2+</td>
|
||||
<td class="center">7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Trident</td>
|
||||
<td>AOL browser (AOL desktop)</td>
|
||||
<td>Win XP</td>
|
||||
<td class="center">6</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 1.0</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 1.5</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 2.0</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Firefox 3.0</td>
|
||||
<td>Win 2k+ / OSX.3+</td>
|
||||
<td class="center">1.9</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Camino 1.0</td>
|
||||
<td>OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Camino 1.5</td>
|
||||
<td>OSX.3+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Netscape 7.2</td>
|
||||
<td>Win 95+ / Mac OS 8.6-9.2</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Netscape Browser 8</td>
|
||||
<td>Win 98SE+</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Netscape Navigator 9</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.0</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.1</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.2</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.2</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.3</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.3</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.4</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.4</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.5</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.6</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">1.6</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.7</td>
|
||||
<td>Win 98+ / OSX.1+</td>
|
||||
<td class="center">1.7</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Mozilla 1.8</td>
|
||||
<td>Win 98+ / OSX.1+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Seamonkey 1.1</td>
|
||||
<td>Win 98+ / OSX.2+</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Gecko</td>
|
||||
<td>Epiphany 2.20</td>
|
||||
<td>Gnome</td>
|
||||
<td class="center">1.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 1.2</td>
|
||||
<td>OSX.3</td>
|
||||
<td class="center">125.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 1.3</td>
|
||||
<td>OSX.3</td>
|
||||
<td class="center">312.8</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 2.0</td>
|
||||
<td>OSX.4+</td>
|
||||
<td class="center">419.3</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>Safari 3.0</td>
|
||||
<td>OSX.4+</td>
|
||||
<td class="center">522.1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>OmniWeb 5.5</td>
|
||||
<td>OSX.4+</td>
|
||||
<td class="center">420</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>iPod Touch / iPhone</td>
|
||||
<td>iPod</td>
|
||||
<td class="center">420.1</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Webkit</td>
|
||||
<td>S60</td>
|
||||
<td>S60</td>
|
||||
<td class="center">413</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 7.0</td>
|
||||
<td>Win 95+ / OSX.1+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 7.5</td>
|
||||
<td>Win 95+ / OSX.2+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 8.0</td>
|
||||
<td>Win 95+ / OSX.2+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 8.5</td>
|
||||
<td>Win 95+ / OSX.2+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 9.0</td>
|
||||
<td>Win 95+ / OSX.3+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 9.2</td>
|
||||
<td>Win 88+ / OSX.3+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera 9.5</td>
|
||||
<td>Win 88+ / OSX.3+</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Opera for Wii</td>
|
||||
<td>Wii</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Nokia N800</td>
|
||||
<td>N800</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Presto</td>
|
||||
<td>Nintendo DS browser</td>
|
||||
<td>Nintendo DS</td>
|
||||
<td class="center">8.5</td>
|
||||
<td class="center">C/A<sup>1</sup></td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>KHTML</td>
|
||||
<td>Konqureror 3.1</td>
|
||||
<td>KDE 3.1</td>
|
||||
<td class="center">3.1</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>KHTML</td>
|
||||
<td>Konqureror 3.3</td>
|
||||
<td>KDE 3.3</td>
|
||||
<td class="center">3.3</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>KHTML</td>
|
||||
<td>Konqureror 3.5</td>
|
||||
<td>KDE 3.5</td>
|
||||
<td class="center">3.5</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Tasman</td>
|
||||
<td>Internet Explorer 4.5</td>
|
||||
<td>Mac OS 8-9</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Tasman</td>
|
||||
<td>Internet Explorer 5.1</td>
|
||||
<td>Mac OS 7.6-9</td>
|
||||
<td class="center">1</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Tasman</td>
|
||||
<td>Internet Explorer 5.2</td>
|
||||
<td>Mac OS 8-X</td>
|
||||
<td class="center">1</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Misc</td>
|
||||
<td>NetFront 3.1</td>
|
||||
<td>Embedded devices</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeA">
|
||||
<td>Misc</td>
|
||||
<td>NetFront 3.4</td>
|
||||
<td>Embedded devices</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">A</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Misc</td>
|
||||
<td>Dillo 0.8</td>
|
||||
<td>Embedded devices</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Misc</td>
|
||||
<td>Links</td>
|
||||
<td>Text only</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeX">
|
||||
<td>Misc</td>
|
||||
<td>Lynx</td>
|
||||
<td>Text only</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">X</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Misc</td>
|
||||
<td>IE Mobile</td>
|
||||
<td>Windows Mobile 6</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeC">
|
||||
<td>Misc</td>
|
||||
<td>PSP browser</td>
|
||||
<td>PSP</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">C</td>
|
||||
</tr>
|
||||
<tr class="gradeU">
|
||||
<td>Other browsers</td>
|
||||
<td>All others</td>
|
||||
<td>-</td>
|
||||
<td class="center">-</td>
|
||||
<td class="center">U</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Rendering engine</th>
|
||||
<th>Browser</th>
|
||||
<th>Platform(s)</th>
|
||||
<th>Engine version</th>
|
||||
<th>CSS grade</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
<div class="spacer"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
268
media/unit_testing/tests_onhold/1_dom/aoColumns.bVisible2.js
Executable file
268
media/unit_testing/tests_onhold/1_dom/aoColumns.bVisible2.js
Executable file
@ -0,0 +1,268 @@
|
||||
// DATA_TEMPLATE: complex_header_2
|
||||
oTest.fnStart( "aoColumns.bVisible with complex headers" );
|
||||
|
||||
$(document).ready( function () {
|
||||
/* Check the default */
|
||||
var oTable = $('#example').dataTable();
|
||||
var oSettings = oTable.fnSettings();
|
||||
|
||||
oTest.fnTest(
|
||||
"All columns are visible by default",
|
||||
null,
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 5; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the first column",
|
||||
function () {
|
||||
oSession.fnRestore();
|
||||
$('#example').dataTable( {
|
||||
"aoColumns": [
|
||||
{ "bVisible": false },
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
} );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '2' - first column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has colspan of 3",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('colspan') == 3; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column is '11'",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)').html() == 11; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column has been truncated to one column",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the second column",
|
||||
function () {
|
||||
oSession.fnRestore();
|
||||
$('#example').dataTable( {
|
||||
"aoColumns": [
|
||||
null,
|
||||
{ "bVisible": false },
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
} );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '1' - second column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "1"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell is '2' - second column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in fourth row is '10' (visibly the first) - second column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(3) th:eq(0)').html() == "10"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has colspan of 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has colspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('colspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has rowspan of 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('rowspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column is '11'",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)').html() == 11; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column has been truncated to one column",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the first two columns",
|
||||
function () {
|
||||
oSession.fnRestore();
|
||||
$('#example').dataTable( {
|
||||
"aoColumns": [
|
||||
{ "bVisible": false },
|
||||
{ "bVisible": false },
|
||||
null,
|
||||
null,
|
||||
null
|
||||
]
|
||||
} );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 3; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '2' - first two columns hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell is '3' - first two columns hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)').html() == "3"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in third row is '6' - first two columns hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(0)').html() == "6"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has colspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('colspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has rowspan of 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('rowspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column is '12'",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)').html() == 12; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the third column",
|
||||
function () {
|
||||
oSession.fnRestore();
|
||||
$('#example').dataTable( {
|
||||
"aoColumns": [
|
||||
null,
|
||||
null,
|
||||
{ "bVisible": false },
|
||||
null,
|
||||
null
|
||||
]
|
||||
} );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '1' - third column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "1"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell is '2' - third column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell (visible second) in third row is '6' - third column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(0)').html() == "6"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has colspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('colspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row first cell (second visible) colspan is 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row second cell (third visible) value is 7",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(1)').html() == "7"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row second cell (third visible) colspan is 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(1)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row second cell (third visible) rowspan is 3",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(1)')[0].getAttribute('rowspan') == 3; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnComplete();
|
||||
} );
|
77
media/unit_testing/tests_onhold/1_dom/bSortCellsTop.js
Executable file
77
media/unit_testing/tests_onhold/1_dom/bSortCellsTop.js
Executable file
@ -0,0 +1,77 @@
|
||||
// DATA_TEMPLATE: dom_data_two_headers
|
||||
oTest.fnStart( "bSortCellsTop" );
|
||||
|
||||
$(document).ready( function () {
|
||||
/* Check the default */
|
||||
var oTable = $('#example').dataTable();
|
||||
var oSettings = oTable.fnSettings();
|
||||
|
||||
oTest.fnTest(
|
||||
"Sorting class is on the bottom cells by default",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(1) th:eq(0)').hasClass('sorting_asc'); }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Sorting is performed on bottom cells",
|
||||
function () { return $('#example thead tr:eq(1) th:eq(0)').click(); },
|
||||
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Sorting class is updated on the bottom cells",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(1) th:eq(0)').hasClass('sorting_desc'); }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Clicking on top cells has no effect",
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').click(); },
|
||||
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Clicking on another top cell has no effect",
|
||||
function () { return $('#example thead tr:eq(0) th:eq(3)').click(); },
|
||||
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Sorting class is on the top cell when bSortCellsTop is true",
|
||||
function () {
|
||||
oSession.fnRestore();
|
||||
$('#example').dataTable( {
|
||||
"bSortCellsTop": true
|
||||
} );
|
||||
},
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').hasClass('sorting_asc'); }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Sorting is performed on top cells now",
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').click(); },
|
||||
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Sorting class is updated on the top cells",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').hasClass('sorting_desc'); }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Clicking on bottom cells has no effect",
|
||||
function () { return $('#example thead tr:eq(1) th:eq(0)').click(); },
|
||||
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Clicking on another bottom cell has no effect",
|
||||
function () { return $('#example thead tr:eq(1) th:eq(3)').click(); },
|
||||
function () { return $('#example tbody tr:eq(0) td:eq(0)').html() == "Webkit"; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnComplete();
|
||||
} );
|
120
media/unit_testing/tests_onhold/1_dom/fnSetColumnVis.js
Executable file
120
media/unit_testing/tests_onhold/1_dom/fnSetColumnVis.js
Executable file
@ -0,0 +1,120 @@
|
||||
// DATA_TEMPLATE: dom_data
|
||||
oTest.fnStart( "fnSetColumnVis" );
|
||||
|
||||
$(document).ready( function () {
|
||||
/* Check the default */
|
||||
var oTable = $('#example').dataTable();
|
||||
var oSettings = oTable.fnSettings();
|
||||
|
||||
oTest.fnTest(
|
||||
"All columns are visible by default",
|
||||
null,
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 5; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Can hide one column and it removes td column from DOM",
|
||||
function () {
|
||||
oSession.fnRestore();
|
||||
$('#example').dataTable();
|
||||
$('#example').dataTable().fnSetColumnVis( 1, false );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Can hide one column and it removes thead th column from DOM",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Can hide one column and it removes tfoot th column from DOM",
|
||||
null,
|
||||
function () { return $('#example tfoot tr:eq(0) th').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"The correct thead column has been hidden",
|
||||
null,
|
||||
function () {
|
||||
var jqNodes = $('#example thead tr:eq(0) th');
|
||||
var bReturn =
|
||||
jqNodes[0].innerHTML == "Rendering engine" &&
|
||||
jqNodes[1].innerHTML == "Platform(s)" &&
|
||||
jqNodes[2].innerHTML == "Engine version" &&
|
||||
jqNodes[3].innerHTML == "CSS grade";
|
||||
return bReturn;
|
||||
}
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"The correct tbody column has been hidden",
|
||||
function () {
|
||||
oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } );
|
||||
},
|
||||
function () {
|
||||
var jqNodes = $('#example tbody tr:eq(0) td');
|
||||
var bReturn =
|
||||
jqNodes[0].innerHTML == "Gecko" &&
|
||||
jqNodes[1].innerHTML == "Gnome" &&
|
||||
jqNodes[2].innerHTML == "1.8" &&
|
||||
jqNodes[3].innerHTML == "A";
|
||||
return bReturn;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Can hide multiple columns and it removes td column from DOM",
|
||||
function () {
|
||||
oSession.fnRestore();
|
||||
$('#example').dataTable();
|
||||
$('#example').dataTable().fnSetColumnVis( 1, false );
|
||||
$('#example').dataTable().fnSetColumnVis( 2, false );
|
||||
$('#example').dataTable().fnSetColumnVis( 4, false );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Multiple hide - removes thead th column from DOM",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th').length == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Multiple hide - removes tfoot th column from DOM",
|
||||
null,
|
||||
function () { return $('#example tfoot tr:eq(0) th').length == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Multiple hide - the correct thead columns have been hidden",
|
||||
null,
|
||||
function () {
|
||||
var jqNodes = $('#example thead tr:eq(0) th');
|
||||
var bReturn =
|
||||
jqNodes[0].innerHTML == "Rendering engine" &&
|
||||
jqNodes[1].innerHTML == "Engine version"
|
||||
return bReturn;
|
||||
}
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Multiple hide - the correct tbody columns have been hidden",
|
||||
function () {
|
||||
oDispacher.click( $('#example thead th:eq(1)')[0], { 'shift': true } );
|
||||
},
|
||||
function () {
|
||||
var jqNodes = $('#example tbody tr:eq(0) td');
|
||||
var bReturn =
|
||||
jqNodes[0].innerHTML == "Gecko" &&
|
||||
jqNodes[1].innerHTML == "1"
|
||||
return bReturn;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
oTest.fnComplete();
|
||||
} );
|
236
media/unit_testing/tests_onhold/1_dom/fnSetColumnVis2.js
Executable file
236
media/unit_testing/tests_onhold/1_dom/fnSetColumnVis2.js
Executable file
@ -0,0 +1,236 @@
|
||||
// DATA_TEMPLATE: complex_header_2
|
||||
oTest.fnStart( "fnSetColumnVis with complex headers" );
|
||||
|
||||
$(document).ready( function () {
|
||||
/* Check the default */
|
||||
var oTable = $('#example').dataTable();
|
||||
var oSettings = oTable.fnSettings();
|
||||
|
||||
oTest.fnTest(
|
||||
"All columns are visible by default",
|
||||
null,
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 5; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the first column",
|
||||
function () {
|
||||
$('#example').dataTable().fnSetColumnVis( 0, false );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '2' - first column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has colspan of 3",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('colspan') == 3; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column is '11'",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)').html() == 11; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column has been truncated to one column",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the second column",
|
||||
function () {
|
||||
$('#example').dataTable().fnSetColumnVis( 0, true );
|
||||
$('#example').dataTable().fnSetColumnVis( 1, false );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '1' - second column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "1"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell is '2' - second column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in fourth row is '10' (visibly the first) - second column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(3) th:eq(0)').html() == "10"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has colspan of 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has colspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('colspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has rowspan of 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('rowspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column is '11'",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)').html() == 11; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column has been truncated to one column",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the first two columns",
|
||||
function () {
|
||||
$('#example').dataTable().fnSetColumnVis( 0, false );
|
||||
$('#example').dataTable().fnSetColumnVis( 1, false );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 3; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '2' - first two columns hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell is '3' - first two columns hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)').html() == "3"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in third row is '6' - first two columns hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(0)').html() == "6"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has colspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('colspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has rowspan of 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('rowspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell in last column is '12'",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(4) th:eq(0)').html() == 12; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnTest(
|
||||
"Hide the third column",
|
||||
function () {
|
||||
$('#example').dataTable().fnSetColumnVis( 0, true );
|
||||
$('#example').dataTable().fnSetColumnVis( 1, true );
|
||||
$('#example').dataTable().fnSetColumnVis( 2, false );
|
||||
},
|
||||
function () { return $('#example tbody tr:eq(0) td').length == 4; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell is '1' - third column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(0)').html() == "1"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell is '2' - third column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)').html() == "2"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"First cell (visible second) in third row is '6' - third column hidden",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(0)').html() == "6"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has colspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('colspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Second cell has rowspan of 2",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(0) th:eq(1)')[0].getAttribute('rowspan') == 2; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row first cell (second visible) colspan is 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(0)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row second cell (third visible) value is 7",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(1)').html() == "7"; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row second cell (third visible) colspan is 1",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(1)')[0].getAttribute('colspan') == 1; }
|
||||
);
|
||||
|
||||
oTest.fnTest(
|
||||
"Third row second cell (third visible) rowspan is 3",
|
||||
null,
|
||||
function () { return $('#example thead tr:eq(2) th:eq(1)')[0].getAttribute('rowspan') == 3; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnComplete();
|
||||
} );
|
Loading…
x
Reference in New Issue
Block a user