mirror of
https://github.com/DataTables/DataTables.git
synced 2025-01-18 11:52:11 +01:00
Fixed: Columns with zero length strings only in them and with a given width would be missed from the width calculations - 2530
This commit is contained in:
parent
151b0ace94
commit
2c76d845d6
45
media/unit_testing/templates/dymanic_table.php
Normal file
45
media/unit_testing/templates/dymanic_table.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?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>
|
||||
<script type="text/javascript" charset="utf-8">
|
||||
$(document).ready( function () {
|
||||
$('#demo').html( '<table cellpadding="0" cellspacing="0" border="0" class="display" id="example"></table>' );
|
||||
} );
|
||||
</script>
|
||||
<?php
|
||||
$aScripts = split( ":", $_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> dynamic table template
|
||||
</div>
|
||||
|
||||
<h1>Live example</h1>
|
||||
<div id="demo"></div>
|
||||
<div class="spacer"></div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
29
media/unit_testing/tests_onhold/1_dom/2530.js
Executable file
29
media/unit_testing/tests_onhold/1_dom/2530.js
Executable file
@ -0,0 +1,29 @@
|
||||
// DATA_TEMPLATE: dymanic_table
|
||||
oTest.fnStart( "2530 - Check width's when dealing with empty strings" );
|
||||
|
||||
|
||||
$(document).ready( function () {
|
||||
$('#example').dataTable( {
|
||||
"aaData": [
|
||||
['','Internet Explorer 4.0','Win 95+','4','X'],
|
||||
['','Internet Explorer 5.0','Win 95+','5','C']
|
||||
],
|
||||
"aoColumns": [
|
||||
{ "sTitle": "", "sWidth": "40px" },
|
||||
{ "sTitle": "Browser" },
|
||||
{ "sTitle": "Platform" },
|
||||
{ "sTitle": "Version", "sClass": "center" },
|
||||
{ "sTitle": "Grade", "sClass": "center" }
|
||||
]
|
||||
} );
|
||||
|
||||
/* Basic checks */
|
||||
oTest.fnTest(
|
||||
"Check calculated widths",
|
||||
null,
|
||||
function () { return $('#example tbody tr td:eq(0)').width() < 100; }
|
||||
);
|
||||
|
||||
|
||||
oTest.fnComplete();
|
||||
} );
|
Loading…
x
Reference in New Issue
Block a user