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

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

  •  11-07-2023
  •  | 
  •  

문제

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?

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top