1
0
mirror of https://github.com/DataTables/DataTables.git synced 2025-03-15 16:29:16 +01:00

Fixed: Column widths we being calculated by not applied. Due to the column width calculation now being done after the header is drawn, the widths need to be likewise done afterwards.

This commit is contained in:
Allan Jardine 2010-09-07 18:21:05 +01:00
parent fde6ba858a
commit 4154332be2

View File

@ -2189,6 +2189,8 @@
*/
function _fnInitalise ( oSettings )
{
var i, iLen;
/* Ensure that the table data is fully initialised */
if ( oSettings.bInitialised === false )
{
@ -2202,12 +2204,20 @@
/* Draw the headers for the table */
_fnDrawHead( oSettings );
/* Calculate sizes for columns */
/* Calculate sizes for columns xxx */
if ( oSettings.oFeatures.bAutoWidth )
{
_fnCalculateColumnWidths( oSettings );
}
for ( i=0, iLen=oSettings.aoColumns.length ; i<iLen ; i++ )
{
if ( oSettings.aoColumns[i].sWidth !== null )
{
oSettings.aoColumns[i].nTh.style.width = _fnStringToCss( oSettings.aoColumns[i].sWidth );
}
}
/* If there is default sorting required - let's do it. The sort function
* will do the drawing for us. Otherwise we draw the table
*/
@ -2229,7 +2239,7 @@
oSettings.fnServerData.call( oSettings.oInstance, oSettings.sAjaxSource, [], function(json) {
/* Got the data - add it to the table */
for ( var i=0 ; i<json.aaData.length ; i++ )
for ( i=0 ; i<json.aaData.length ; i++ )
{
_fnAddData( oSettings, json.aaData[i] );
}
@ -2733,12 +2743,6 @@
if ( oSettings.aoColumns[i].bVisible )
{
/* Set width */
if ( oSettings.aoColumns[i].sWidth !== null )
{
nTh.style.width = oSettings.aoColumns[i].sWidth;
}
/* Set the title of the column if it is user defined (not what was auto detected) */
if ( oSettings.aoColumns[i].sTitle != nTh.innerHTML )
{
@ -2769,11 +2773,6 @@
nTh.className = oSettings.aoColumns[i].sClass;
}
if ( oSettings.aoColumns[i].sWidth !== null )
{
nTh.style.width = oSettings.aoColumns[i].sWidth;
}
nTr.appendChild( nTh );
}
}