Skip to content

Commit 502612f

Browse files
committed
fix: caricamento altre operazioni stato dei servizi
1 parent 1c8f9aa commit 502612f

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

modules/stato_servizi/edit.php

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -542,28 +542,16 @@ function caricaElencoOperazioni() {
542542
543543
function caricaAltreOperazioni(offset, limit) {
544544
let container = $("#operazioni");
545-
let currentContent = container.find("table tbody");
546-
let loadMoreButton = container.find(".text-center");
547545
548-
// Mostra loading sul pulsante
549-
loadMoreButton.html("<i class=\"fa fa-refresh fa-spin\"></i> '.tr('Caricamento...').'");
546+
// Mostra loading
547+
localLoading(container, true);
550548
551549
$.get("'.$structure->fileurl('elenco-operazioni.php').'?id_module='.$id_module.'&offset=" + offset + "&limit=" + limit, function(data) {
552-
let newData = $(data);
553-
let newRows = newData.find("tbody tr");
554-
let newLoadMore = newData.find(".text-center");
555-
556-
// Aggiungi le nuove righe alla tabella esistente
557-
if (newRows.length > 0) {
558-
currentContent.append(newRows);
559-
}
550+
// Sostituisci completamente il contenuto del container
551+
container.html(data);
552+
localLoading(container, false);
560553
561-
// Sostituisci il pulsante "Carica di più" o rimuovilo se non ci sono più dati
562-
if (newLoadMore.length > 0) {
563-
loadMoreButton.replaceWith(newLoadMore);
564-
} else {
565-
loadMoreButton.remove();
566-
}
554+
console.log("Caricate nuove operazioni dall\'offset:", offset);
567555
568556
init();
569557
});

0 commit comments

Comments
 (0)