Fix in _fnCalculateColumnWidths

Fix in _fnCalculateColumnWidths

ivictborivictbor Posts: 6Questions: 2Answers: 0

On odd times when I do:

var column = oTable.api().column( $(this).attr('data-column') );
column.visible( ! column.visible() );

There is "Uncaught TypeError: Cannot read property 'style' of undefined" on:

headerCells[i].style.width = column.sWidthOrig !== null && column.sWidthOrig !== '' ?
                        _fnStringToCss( column.sWidthOrig ) :
                        '';

and header becomes broken.

Simple checking for undefined, at least dont brake table.

if(headerCells[i] !== undefined){
                    headerCells[i].style.width = column.sWidthOrig !== null && column.sWidthOrig !== '' ?
                        _fnStringToCss( column.sWidthOrig ) :
                        '';
                }

Replies

  • allanallan Posts: 63,680Questions: 1Answers: 10,498 Site admin

    Could you confirm which version of DataTables you are using please? If 1.10.7, can you try the 1.10.8-dev nightly please?

    Allan

This discussion has been closed.