Hide elements while exporting
Hide elements while exporting
chattu289
Posts: 4Questions: 1Answers: 0
Is there a way to hide a part of the column while exporting.
I have few hidden elements in datatable, which will be invisible in HTML, but visible when export/print.
I want to hide those elements in export/print also.
Thanks in Advance.
This discussion has been closed.
Answers
I think this example of exporting with Column Selectors will help you:
https://datatables.net/extensions/buttons/examples/html5/columns.html
Kevin
The link shared will help to customize columns to show.
But I need to hide a part of column(few elements) but not whole.
Maybe this example will give you some ideas:
https://datatables.net/extensions/buttons/examples/html5/outputFormat-orthogonal.html
If this doesn't help maybe you can post a bit more detail of how it is determine what portions to hide from the export.
Kevin
I have a date column, in which there will be empty data for few rows. So it is treated as string and sorting as a string.
So to fix this, I added date in yyyy/mm/dd format at the beginning and made it display none, so that data will be sorted accorting to yyyy/mm/dd, but that will be not be show in the page. But when I tried to export it show the two dates like yyyy/mm/ddmm/dd/yyyy.
So, I am trying to hide the first date in export.
@kthorngren thanks for helping me out...
My problem got solved in a different way, I just removed span with in td elements, so that it treated it as date column and sorted properly.