function searchExport() { var user = document.getElementById("user").value; var source = document.getElementById("source").value; var start_date = document.getElementById("start_date").value; var end_date = document.getElementById("end_date").value; if(source == "") { ErrorAlert("Origine deve avere un valore"); return } document.getElementById("search_button").style.display = 'none'; document.getElementById("search_loader").style.display = 'block'; var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (this.readyState == 4 && this.status == 200) { document.querySelector("#search_result_content").innerHTML = this.responseText; document.getElementById("search_button").style.display = 'block'; document.getElementById("search_loader").style.display = 'none'; $(document).ready( function () { new DataTable('#search_result_table', { paging: false, scrollCollapse: true, scrollY: '500px', layout: { topStart: { buttons: [ { extend: 'colvis', postfixButtons: ['colvisRestore'], popoverTitle: 'Visibilità colonne' }, 'print','excel','pdf', 'csv' ] } }, language: { emptyTable: "Nessun dato presente nella tabella", search: "Cerca:", infoEmpty: "Visualizzati da 0 a 0 di 0 risultati", info: "Visualizzati da _START_ a _END_ di _TOTAL_ risultati", buttons: { print: "Stampa", colvis: "Visualizza", colvisRestore: "Ripristina visualizzazione" } }, order: { idx: 0, dir: 'desc' } }); } ); } }; xmlhttp.open("GET", "public/exports/export_list.php?user="+user+"&source="+source+"&start_date="+start_date+"&end_date="+end_date); xmlhttp.send(); }