I am try to add export buttons to my datatable, my table include select boxes inside, the problem is - it export all the options values included in the select box... A am us
Use exportOptions
'format.body
callback to get control over the exported data. Use the dataTables API to find the current selected value for each box. Here for the first column and pdf :
buttons: [
{
extend : 'pdf',
exportOptions : {
format: {
body: function( data, row, col, node ) {
if (col == 0) {
return table
.cell( {row: row, column: col} )
.nodes()
.to$()
.find(':selected')
.text()
} else {
return data;
}
}
}
},
...
}
]
Where table
is the table instance, in your case me.dataTable_obj
. Now just change if (col == 0) {
so it respond to the columns where you have boxes (I dont know that).