"bAutoWidth": false IE 8 Exception

"bAutoWidth": false IE 8 Exception

jskrojskro Posts: 1Questions: 0Answers: 0
edited May 2013 in Bug reports
I'm not quite sure under what circumstances this exception can be reproduced, but I'll try to provide as much information as I can.

Datatables Version: 1.9.4

Datatable Settings Used:
"sScrollY": "465px"
"bScrollCollapse": true
"bAutoWidth": false

Code Throwing Exception:
// Apply all widths in final pass. Invalidates layout only once because we do not
// read any DOM properties.
_fnApplyToChildren( function(nToSize, i) {
nToSize.style.width = aApplied[i];
}, anHeadToSize );

Problem:
aApplied has a length of 0 in certain situations when using IE8. This causes aApplied[i] to throw an "invalid argument" exception in IE8.

Changing bAutoWidth to true causes this exception to disappear, but I do not want the widths calculated automatically. I have modified this method in the datatables script to check and ensure aApplied.length is greater than 0 prior to attempting to access the array index:

// Apply all widths in final pass. Invalidates layout only once because we do not
// read any DOM properties.
_fnApplyToChildren( function(nToSize, i) {
if(aApplied.length > 0) nToSize.style.width = aApplied[i];
}, anHeadToSize );

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Please link to a test case showing the problem.

    Allan
This discussion has been closed.