PDF Button extend options -- messageTop not working with doc.content[1].table.widths
PDF Button extend options -- messageTop not working with doc.content[1].table.widths
Hi,
I'm trying to extend pdfHtml5 to include a top message and set column widths. Example code is here:
https://jsfiddle.net/mtilton/j20L7soe/
However, the page just hangs when the user clicks on the PDF button. Strangely, messageBottom works fine. The code also works when the doc.content[1].table.widths line is removed -- but I need this.
In the actual code I'm running, I use a local copy of datatables 1.10.18 and buttons 1.5.4. Clicking on the PDF button with messageBottom works, but messageTop generates a javascript error:
"Uncaught TypeError: Cannot set property 'widths' of undefined
at Object.customize
at s.action (buttons.html5.min.js:35)
at v (dataTables.buttons.min.js:16)
at HTMLButtonElement.<anonymous> (dataTables.buttons.min.js:17)
at HTMLButtonElement.dispatch (jquery.min.js:4)
at HTMLButtonElement.r.handle (jquery.min.js:4)"
Thanks for any suggestions.
Meg
Answers
Hi, my coworker just found the following, which solves the problem. (I did search myself but apparently wasn't using the right terms.)
https://datatables.net/forums/discussion/35884/pdf-export-cannot-customise-column-widths-and-add-message