Error when deleting a row from datatable in subsequent pages when using paging

StackOverflow https://stackoverflow.com/questions/23347668

  •  11-07-2023
  •  | 
  •  

Domanda

Hello everybody I am using jquery datatable and am using the following function to delete rows from the table:

$ (document). ready (function () {
    $ (". delete.") on ("click", function () {
        var tr = $ (this) closest ('tr').;
        tr.css ("background-color", "# FF3700");
        tr.fadeOut (400, function () {
            tr.remove ();
        });
        return false;
    });
});

on the first page is all fine, but when using pagination and try to delete a row from page 2 onwards, nothing happens.

What can it be?

È stato utile?

Soluzione

On pagination click event may be unbinding. Try to bind event on document.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top