per-row buttons locking, progress

This commit is contained in:
2026-03-18 19:58:57 +03:00
parent 5dedc779df
commit eb21910ef3
2 changed files with 42 additions and 1 deletions
+14
View File
@@ -1550,6 +1550,14 @@ function fixedDefaultValue(array $f): string
const rowIndex = btn.dataset.row;
const row = btn.closest('.grid-row');
const iddatadb = row.getAttribute('data-id');
// Show spinner on save button
const origHtml = btn.innerHTML;
btn.innerHTML = '<i class="fas fa-spinner fa-spin"></i>';
btn.disabled = true;
row.style.opacity = '0.6';
row.style.pointerEvents = 'none';
const formData = new FormData();
const inputs = row.querySelectorAll(`input[name^="rows[${rowIndex}][details]"], select[name^="rows[${rowIndex}][details]"]`);
@@ -1638,6 +1646,12 @@ function fixedDefaultValue(array $f): string
})
.catch(error => {
alert('Errore durante il salvataggio: ' + error.message);
})
.finally(() => {
btn.innerHTML = origHtml;
btn.disabled = false;
row.style.opacity = '';
row.style.pointerEvents = '';
});
});
});