开发者

jQuery datatables plugin and only deleting from the first part of a table works

开发者 https://www.devze.com 2023-04-03 18:26 出处:网络
I use jQuery datatables plugin. In my table I have a column for deleting rows. I used this selector in my column开发者_如何学JAVAs:

I use jQuery datatables plugin.

In my table I have a column for deleting rows. I used this selector in my column开发者_如何学JAVAs:

<td> <span class="icon_text accept"></span> </td>

And I wrote some code to delete a row from the table:

   $(".accept").click(function (e) {
       //Delete
   });

Everything works fine, but just in page one of the table. It means if my table has more than one page, the selector does not work.

What should I do?


Change your JavaScript code to:

$(".accept").live('click', function(e) {
    //Delete
});
0

精彩评论

暂无评论...
验证码 换一张
取 消