Buttons Error:Unable to get property 'length' of undefined or null reference

Buttons Error:Unable to get property 'length' of undefined or null reference

rkarka Posts: 3Questions: 1Answers: 0

In File: buttons.html5.js, Line: 505, Column: 19

If the table doesn't have a footer, the export to excel doesn't work. The code in the buttons.html5.js looks like below. The 2nd if condition should only check for config.footer and not header.

    if ( config.header ) {
        xml += addRow( data.header );
    }

    for ( var i=0, ien=data.body.length ; i<ien ; i++ ) {
        xml += addRow( data.body[i] );
    }

    if ( config.header ) {
        xml += addRow( data.footer );
    }

Answers

  • allanallan Posts: 64,032Questions: 1Answers: 10,555 Site admin

    Hi,

    This is a packaging error. The file included in the DataTables 1.10.8 zip file has this error, but a last minute fix corrected the error and the CDN and downloader versions have the fix in place.

    I'll be rebuilding the DataTables zip file soon. In future, i'll probably remove the extensions from the DataTables zip so they can be downloaded separately as needed.

    Regards,
    Allan

  • rkarka Posts: 3Questions: 1Answers: 0

    Thanks. Downloaded the library from CDN. Works as expected.

This discussion has been closed.