_fnCalculateColumnWidths

_fnCalculateColumnWidths

neilsgniitneilsgniit Posts: 3Questions: 0Answers: 0
edited September 2012 in DataTables 1.9
hello i'm new to using datatables ,and the experience till now is marvellous
But i have a small problem with the function _fnCalculateColumnWidths
[code]
var cssWidth = $(nCalcTmp).css('width');
oSettings.nTable.style.width = (cssWidth.indexOf('%') !== -1) ? cssWidth : _fnStringToCss($(nCalcTmp).outerWidth());
[/code]

The nCalcTmp returns a list sometimes which causes an error .
i guess the problem is with my dom .
i have two rows of th in the thead section .

for time being i have converted one of the rows to td which is working fine ,
but as soon as i try to use the colvis plugin the again the error occurs in the _fnStringToCss as it tries [code] s.charCodeAt(s.length - 1); [/code]

the best possible i did to resolve the problem is
[code]
if (cssWidth.indexOf('px') == 0) {
oSettings.nTable.style.width = (cssWidth.indexOf('%') !== -1) ?
cssWidth : _fnStringToCss($(nCalcTmp).outerWidth());
}
else {
oSettings.nTable.style.width = cssWidth;
}
[/code]

Please help as i am not well versed with jquery .

Replies

  • neilsgniitneilsgniit Posts: 3Questions: 0Answers: 0
    Problem solved :)

    just use jquery_ui 1.8.22 or higher and it works without any changes to datables.js

    Thanks and Regards
    Nilesh Patel
This discussion has been closed.