Export visible columns PLUS one extra column to excel
Export visible columns PLUS one extra column to excel
patrickny
Posts: 15Questions: 7Answers: 0
I use the following code to export Visible Columns only to excel. It works great!
buttons: [ {
extend: 'excel',
exportOptions: {
columns: ':visible'
}
}, 'print',],
I am looking to add one additional column, which is hidden, to the export. So, in essence, it'll be exporting all the visible, plus column 3 and 4, which are hidden.
Is this possible?
Replies
Got it!
Add class 'hc' (or any class, really) to the <th> and <td> of the extra column which i will hide in datables -- and add .hc to the columns in the export.
Yup - that's how to do it. Nice one.
Allan