add confirm dialog when delete one item in events table

This commit is contained in:
marcos 2020-06-04 11:08:51 +02:00
parent 0bd255924f
commit 4904718c41
1 changed files with 20 additions and 5 deletions

View File

@ -712,7 +712,7 @@ function update_event(table, id_evento, type, event_rep, row) {
values[this.name] = $(this).val();
});
var t1 = new Date();
console.log("al ajax directo");
// Update events matching current filters and id_evento selected.
$.ajax({
async: true,
@ -791,10 +791,25 @@ function delete_event(table, id_evento, event_rep, row) {
processed += 1;
return;
}
button.children[0];
button.children[0].src = "images/spinner.gif";
return update_event(table, id_evento, { delete_event: 1 }, event_rep, row);
confirmDialog({
title: "ATTENTION",
message:
"<h4 style='text-align: center;padding-top: 20px;'>Are you sure?</h4>",
cancel: "Cancel",
ok: "Ok",
onAccept: function() {
// Continue execution.
button.children[0];
button.children[0].src = "images/spinner.gif";
return update_event(
table,
id_evento,
{ delete_event: 1 },
event_rep,
row
);
}
});
}
// Imported from old files.