button pdf, print
button pdf, print
Andreas S.
Posts: 208Questions: 74Answers: 4
in Buttons
I have in the Datatables instead of Male and Female an Icon and if they is a member of a listed group a check icon instead of 1.
if I want to export the table via print pdf the columns are empty. Is it possible to render the field to the icons if someone click on the Buttons? The icons are fontawesome and render into the table.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Yes, you can use orthogonal data or a formatting function.
Allan
I am not sure that I understand the example. I believe, I have already written that with the render option in the Datatables, see the gender part.
The export button should take the Table that is defined. But in the gender Column, is always empty on the exported pages. The icons fa-male and fa-female are not exported
Andreas
I'd need to be able to see the page to be able to debug it.
Thanks,
Allan
here the debug link:
http://debug.datatables.net/ozikog
Andreas
I'm afraid in this case I would need to be able to see a page rather than the debug trace.
Allan
I Send you a message to the link
Andreas
Thanks for the links in the PM.
Looking at the page I see the issue now. You are indeed using a rendering function for the
gender
column, which is always returning an HTMLi
element. Buttons strips HTML by default, which explains why you see nothing in the exported file.As I mentioned above you need to use the orthogonal export options for Buttons, and then in your rendering function simply do:
Allan
Thanks, now I understand it. Is it possible for export to set a different font, the value to the center or a fontcolor in the cell?
Andreas
Yes - you would use the
customize
callback to modify the generated XML for the XLSX file.Allan