Deleting a row in a table reappears when getting back to original page

I have table showing rows and at the end of each row there are some buttons that when I click on delete, it sends the request and successfully removes the data from the database and also deletes the row, but when I go to another section of the page, and then come back, the registry still appears there.

I’m using datatables for the table.

the button actions is this:

$(document).on(‘click’, ‘.deleteProject’,function(){
///code ///
});

I think this was some sort of cache problem so I have also this:

var myApp = new Framework7({
    animateNavBackIcon: true,
    cache:false,
    // Enable templates auto precompilation
    precompileTemplates: true,
    // Enabled pages rendering using Template7
    swipeBackPage: false,
    swipePanelOnlyClose: true,
    pushState: true,
    template7Pages: true
});

Can you share your pageInit code as well

There isn’t much actually.

this is the code that deletes the row.

myApp.onPageInit('informe', function (page) {

$('.modaltrash').click(function(){
            var id = $(this).attr('data-id');
            Swal.fire({
                title: '¿Estás seguro?',
                text: "¿Deseas sacar del proyecto a "+ $(this).attr('data-nombre') + "?",
                icon: 'warning',
                showCancelButton: true,
                confirmButtonColor: '#3085d6',
                cancelButtonColor: '#d33',
                confirmButtonText: 'Confirmar',
                cancelButtonText: 'Cancelar'
              }).then((result) => {
                if (result.value) {
                        $.ajax({
                            method:'POST',
                            data:{
                                'id': $(this).attr('data-id'),
                                '_token': $('meta[name="csrf-token"]').attr('content')
                            },
                            url: 'eliminarEvaluacionesUsuario',
                            success: function(respuesta) {
                                if(respuesta.success == true){
                                    Swal.fire(
                                        'Éxito',
                                        'Tus cambios han sido guardados.',
                                        'success'
                                      ).then((result) => {
                                      $('.tr'+id).fadeOut(2000);
                                      setTimeout(function(){ 
                                        window.location.reload();    
                                       }, 2000);
                                        });
                                }else{
                                    Swal.fire(
                                        'Alerta',
                                        'Tus cambios no podido ser realizados.',
                                        'warning'
                                      )
                                }
                            },
                            error: function() {
                                console.log("No se ha podido obtener la información");
                            }
                        });
                    }
              })
            });        



});

viento tu codigo, asumo que hablas español.

algun motivo en particular para usar esa linea? xq no usas el router de f7?

router.refreshPage()

el usuario, se esta borrando de la BD?

por otro lado, es raro volver a cargar toda una pagina la hacer una simple eliminacion.
mejor seria volver a cargar las filas nomas de la tabla y no toda la pagina.