Can the buttons extension print child data added to rows?

Can the buttons extension print child data added to rows?

notserpmhnotserpmh Posts: 2Questions: 1Answers: 0

I'm working on making up a publicly accessible demo, but as a quick question if anyone knows:

I have a DataTable I'm loading with JSON data via Ajax. One part of the the JSON data is being added as a child row to each of the "regular" rows so it spans the whole width. This part is working fine.

I want to use the buttons extensions to have a Print, CSV, and PDF versions. I have these buttons working, except when I go to use any of them, the child row is not included.

I can't find in the docs anywhere if the buttons extensions can even include child data, much less show it. If anyone can point me in the right direction, I'd greatly appreciate it.

Thanks in advance!

This question has an accepted answers - jump to answer

Answers

  • notserpmhnotserpmh Posts: 2Questions: 1Answers: 0

    As an update, here is a working demo:

    http://live.datatables.net/cewuzawa/1/edit?html,css,js,output

    You can see in it there is "Extra Child Info" added as a child row on each of the rows shown. When you click "PDF" though, it doesn't show up. Would there be a better way to add a row like this that would show up or is there a way to make the child info show up?

    Thanks!

  • allanallan Posts: 63,161Questions: 1Answers: 10,406 Site admin
    Answer ✓

    There is currently no built in option to include the child row data in the export. You'd need to use the customize option of the pdfHtml5 button type to modify the output to suit your needs. Likewise for Excel. For CSV it would more than likely just result in an invalid CSV file being created since there would only be one entry for the child row.

    Allan

This discussion has been closed.