Hide filter on button output
Hide filter on button output
I have a table where I have included a filter on a column.
I have column totals in the footer as well, which I want to show on the output (PDF, CSV, print etc)
I have enabled the footer to be added to the output, but I also get the undesired filter code as well. When I set striphtml to true, I get left with the items that were in the filter drop down.
Is it possible to tell the table to output an empty cell rather than the filter code?
Example is here - http://flywestwind.org/testcases/PassengerPilots.php
Thanks
This question has an accepted answers - jump to answer
Answers
You could try orthogonal data using type === 'export'
https://datatables.net/extensions/buttons/examples/html5/outputFormat-orthogonal.html
If that is not possible for the footer you can try export options
https://datatables.net/extensions/buttons/examples/html5/outputFormat-function
https://datatables.net/reference/button/excelHtml5 and more details about export options here
https://datatables.net/reference/api/buttons.exportData()
You can also access the footer:
This should show you how to do this ... more or less:
And here is a thread dealing with the footer in export options as well:
https://datatables.net/forums/discussion/comment/106393/#Comment_106393
I have updated the exportoptions section to be this
However I only see the * character in the footer. I also tried with just the data and column as parameters, but that didn't work either. I'm thinking that column is not an integer, although your example implies that it is for the body section. Is the footer section different
The test case has been updated
OK, found out the issue,
The footer parameters are only data and column, rather than data, row, column, node that one of the linked examples suggested