I have a jquery datatable and I want to use datatable's export to excel feature. But I don't want to show export excel button of datatable instead of this, I want to show my own button and call datatable's export to excel function.
With below code I was able to export the excel sucessfully but as I said above I want to export the excel when user clicked my custom button.
$(document).ready(function () {
var table = $('#example').DataTable({
"paging": false,
"info": false,
searching: false,
dom: 'Bfrtip',
buttons: [
{
extend: 'excelHtml5'
}
]
});
});
I have added click handler using below thread button i don't ant to show datatble's export button. I want make those buttons invisible. How to call Datatable csv button from custom button
DataTable()function when the button is clicked.