1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-02-19 17:54:14 +01:00

Dev fix: Hidden columns could break width calculations - unit test found

This commit is contained in:
Allan Jardine 2011-04-12 21:05:25 +01:00
parent a5bba04353
commit b2d528d0d8

View File

@ -5371,18 +5371,23 @@
/* Apply custom sizing to the cloned header */
var nThs = _fnGetUniqueThs( oSettings, nTheadClone );
iCorrector = 0;
console.log( nThs );
for ( i=0 ; i<iColums ; i++ )
{
var oColumn = oSettings.aoColumns[i];
if ( oColumn.bVisible && oColumn.sWidthOrig !== null && oColumn.sWidthOrig !== "" )
{
nThs[i-iCorrector].style.width = _fnStringToCss( oColumn.sWidthOrig );
iCorrector++;
}
else if ( oColumn.bVisible )
{
console.log( i, iCorrector );
nThs[i-iCorrector].style.width = "";
}
else
{
iCorrector++;
}
}
/* Find the biggest td for each column and put it into the table */