How can I move the "excelHtml5" button function to another button somewhere else?
How can I move the "excelHtml5" button function to another button somewhere else?
Scram
Posts: 1Questions: 1Answers: 0
I am working on a export to excel for my table and am using that:
$(document).ready(function () {
$('#table').DataTable({
dom: 'Bfrtip',
ordering: false,
paging: false,
filter: false,
info: false,
buttons: [
'excelHtml5'
]
});
});
the excel button appears like it should but I already have a button placed on the right place for that function. And I would like to avoid to have to figure out how to customize the "excelHtml5" button so it shows exactly how I want it to.
This discussion has been closed.
Answers
You probably need to hide the
excelHtml5
button (button().node()
to get the node and then use CSS to hide it) and then usebutton().trigger()
on it, called when your other button is activated.Allan