在数据表中确认文件导出后,如何重新加载页面?



我遵循这个例子:

https://datatables.net/extensions/buttons/examples/initialisation/export

我希望如果我确认文件导出,页面将重新加载。我该怎么做?

您可以自定义按钮的操作。 试试这个:

$(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
}
}
]
});
}); 

这是一个工作小提琴

最新更新