Question

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?

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top