File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -542,28 +542,16 @@ function caricaElencoOperazioni() {
542542
543543function 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 });
You can’t perform that action at this time.
0 commit comments