bug in title/filename using file export buttons when svg present on page

bug in title/filename using file export buttons when svg present on page

jraczekjraczek Posts: 1Questions: 1Answers: 0

Hello,

The documentation for the built-in file export buttons in version 1.4.2 states the special character * represents the host document's title tag for the title and filename options. However, <title> is also valid within an svg object. The file export buttons are concatenating all title tags on the page, rather than using only the HTML's title. To correct for this, I have had to include the following in my code:

var t = $('#myTable').DataTable(
    {
        buttons: [
            {
                extend: 'excel',
                filename: $('head > title').text(),
                title: $('head > title').text()
            }
        ]
    }
);

Thanks,
John

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,552Questions: 1Answers: 10,477 Site admin
    Answer ✓

    Hi John,

    Very good point - thanks for bringing that up! I've committed a fix and it will be in the next release (which will be before the end of the month).

    Regards,
    Allan

This discussion has been closed.