Hiding first column and getting only visible columns for export
Hiding first column and getting only visible columns for export
fatihalp
Posts: 8Questions: 2Answers: 1
First column is remain for operations and and unneeded to export.
But get only the visible columns of displaying by the user and export it.
https://datatables.net/extensions/buttons/examples/print/columns.html
Simple with this example I need to also hide first column. Thanks!
This discussion has been closed.
Replies
Good question pal !
If I able to hide column just before print It could also solves the problem.
Where could I put this action to want to run just before action.
In the example you linked to, try adding a class to each <th> that you want printed "print-col". Then modify the exportOptions to following:
Gordon very clever method but datatables gives an error. Jsfiddle example:
https://jsfiddle.net/9ehyrtv3/1/
Changed the order and it works thanks a lot Gordon! :)
columns: ':visible.print-col'