Export button to PDF/Excel etc and dropdown list
Export button to PDF/Excel etc and dropdown list
![nkalexiou](https://secure.gravatar.com/avatar/2448207dc55b4a44f537ed448c9bd4fe/?default=https%3A%2F%2Fvanillicon.com%2F2448207dc55b4a44f537ed448c9bd4fe_200.png&rating=g&size=120)
Hello,
I have a table and one of the columns has a dropdown list with a set of options:
<td>
<select name="customerType" id="customerTypeId">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3" selected="selected">Option 3</option>
</select>
</td>
When I use the export buttons I get the whole list of options for that particular column instead of only the selected option.
I initialize my table like this:
$('#table2').DataTable({
paging: false,
dom: 'Bfrtip',
buttons: [
'copyHtml5',
'excelHtml5',
'csvHtml5',
'pdfHtml5'
]
});
I want to export only the value that is selected. What can I do to fix this?
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
There is currently no option for that in Buttons - sorry. You might be able to do it with orthogonal data and updated the data point when the value is changed, but there isn't a built in way of exporting the select list value.
Allan
Ok thanks for your reply! I'm thinking to create a custom button which will popup a new window with the html table format that Datatables can handle. Then it should be easy to export with Datatables.