/* Convert any user input sizes into pixel sizes */
for ( i=0 ; i<iColums ; i++ )
{
if ( oSettings.aoColumns[i].bVisible )
{
iVisibleColumns++;
if ( oSettings.aoColumns[i].sWidth !== null )
{
iTmpWidth = _fnConvertToWidth( oSettings.aoColumns[i].sWidthOrig,
oSettings.nTable.parentNode );
if ( iTmpWidth !== null )
{
oSettings.aoColumns[i].sWidth = _fnStringToCss( iTmpWidth );
}
iUserInputs++;
}
}
}
/* Convert any user input sizes into pixel sizes */
for ( i=0 ; i<iColums ; i++ )
{
if ( oSettings.aoColumns[i].bVisible )
{
iVisibleColumns++;
if ( oSettings.aoColumns[i].sWidthOrig!== null )
{
iTmpWidth = _fnConvertToWidth( oSettings.aoColumns[i].sWidthOrig,
oSettings.nTable.parentNode );
if ( iTmpWidth !== null )
{
oSettings.aoColumns[i].sWidth = _fnStringToCss( iTmpWidth );
iUserInputs++;
}
}
}
}
if ( oSettings.oScroll.sX === "" && oSettings.oScroll.sY !== "" )
{
/* When y-scrolling only, we want to remove the width of the scroll bar so the table
* + scroll bar will fit into the area avaialble.
*/
var iOrigWidth = $(n).width();
n.style.width = _fnStringToCss( $(n).outerWidth()-oSettings.oScroll.iBarWidth );
}
else if ( oSettings.oScroll.sX !== "" )
{
/* When x-scrolling both ways, fix the table at it's current size, without adjusting */
n.style.width = _fnStringToCss( $(n).outerWidth() );
}
if (oSettings.oScroll.sY !== "")
{
if (oSettings.oScroll.sX === "")
{
/* When y-scrolling only, we want to remove the width of the scroll bar so the table
* + scroll bar will fit into the area avaialble.
*/
var iOrigWidth = $(n).width();
n.style.width = _fnStringToCss($(n).outerWidth() - oSettings.oScroll.iBarWidth);
}
else if (oSettings.oScroll.sX !== "")
{
/* When x-scrolling both ways, fix the table at it's current size, without adjusting */
n.style.width = _fnStringToCss($(n).outerWidth());
}
}
/* When scrolling (X or Y) we want to set the width of the table as appropriate. However,
* when not scrolling leave the table width as it is. This results in slightly different,
* but I think correct behaviour
*/
if (oSettings.oScroll.sX !== "" && oSettings.oScroll.sXInner !== "")
{
nCalcTmp.style.width = _fnStringToCss(oSettings.oScroll.sXInner);
}
if ( oSettings.oScroll.sX !== "" )
{
nCalcTmp.style.width = "";
if ( $(nCalcTmp).width() < nWrapper.offsetWidth )
{
nCalcTmp.style.width = _fnStringToCss( nWrapper.offsetWidth );
}
}
else if ( oSettings.oScroll.sY !== "" )
{
nCalcTmp.style.width = _fnStringToCss( nWrapper.offsetWidth );
}
/* When scrolling (X or Y) we want to set the width of the table as appropriate. However,
* when not scrolling leave the table width as it is. This results in slightly different,
* but I think correct behaviour
*/
if (oSettings.oScroll.sX !== "" && oSettings.oScroll.sXInner !== "")
{
nCalcTmp.style.width = _fnStringToCss(oSettings.oScroll.sXInner);
}
else
{
nCalcTmp.style.width = _fnStringToCss(nWrapper.offsetWidth);
}
var wWidth = $(window).width();
if ($(nCalcTmp).width() > wWidth)
{
nCalcTmp.style.width = _fnStringToCss(wWidth);
}
It looks like you're new here. If you want to get involved, click one of these buttons!
Get useful and friendly help straight from the source.