salve eseguo una importazione di dati ed il tutto funziona correttamente , tranne che
durante l'importazione faccio partire la progress bar che pero non è sincronizzata con il processo che eseguo nel file php .....
Ossia alla fine del processo (SUCCESS) ho un messaggio che comunica il termine dello stesso
ma il problema che la progress bar termina ed il messaggio ancora non arriva perche il file php ancora in esecuzione, oppure arriva il messaggio prima che la progress bar termini, potreste consigliarmi come gestire questa progress bar ???
codice:
function sendTblDataToServer(){
var TableData;
TableData = $.toJSON(storeTblValues());
console.log(TableData);
$('#tbTableValuesArray').val('JSON array to send to server: \n\n' + TableData.replace(/},/g, "},\n"));
$.ajax({
type: "POST",
url: "php/importdata_wbs.php",
data: "pTableData=" + TableData,
dataType: "html",
beforeSend: function(){
$('#add_data_import_wbs').modal('hide');
Lobibox.progress({
title: 'Attendere',
delay: false,
closeButton: true,
label: 'Importazione file in corso...',
onShow: function ($this) {
var i = 0;
var inter = setInterval(function () {
if (i > 100) {
inter = clearInterval(inter);
}
i = i + 0.1;
$this.setProgress(i);
}, 10);
},
progressCompleted:function ($this) {
$this.hide()
}
});
},
success: function(msg){
Lobibox.notify("success",{
title: 'Importazione Terminata con Successo...',
msg: '<br>'+msg,
delay: 10000,
});
},
error : function(msg){
Lobibox.notify("error",{
title: 'Importazione Terminata...',
msg: '<br>'+msg,
delay: 10000,
});
}
});
}