I am following this example:
https://datatables.net/extensions/buttons/examples/initialisation/export
I want if I confirm the file exporting , the page will reload. How can I do this?
I am following this example:
https://datatables.net/extensions/buttons/examples/initialisation/export
I want if I confirm the file exporting , the page will reload. How can I do this?
You can customize the button's action. Try this :
$(document).ready(function() {
$('#example').DataTable( {
dom: 'Bfrtip',
buttons: [
{//Start the creation of the button
extend: "csv",//It's a button that export the table dtat into a CSV file
text: "export and relode",//The text of the button
action: function(e, dt, button, config) {
//The action of the button
$.fn.dataTable.ext.buttons.csvHtml5.action.call(this, e, dt, button, config);//Export the data
window.location.reload(false);//Relode the page
}
}
]
});
});
Here is a working Fiddle