Javascript 在Datatable中确认文件导出后,如何重新加载页面?
我举这个例子:Javascript 在Datatable中确认文件导出后,如何重新加载页面?,javascript,jquery,datatable,Javascript,Jquery,Datatable,我举这个例子: 如果我确认文件导出,页面将重新加载。如何执行此操作?您可以自定义按钮的操作。试试这个: $(document).ready(function() { $('#example').DataTable( { dom: 'Bfrtip', buttons: [ {//Start the creation of the button extend: "csv",//It's a button that export the tab
如果我确认文件导出,页面将重新加载。如何执行此操作?您可以自定义按钮的操作。试试这个:
$(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
}
}
]
});
});
这是一个工作可能的副本