Problem: table sorting and pagination with jquery plugin tablesorter
I have a table which has 100 rows which also has pagination. each page shows up 10 records. I am using jquery plugins tablesorter and pager. Sorting and pagination work like a charm. Now what I am trying to do is to show up a div when i click on each table cell. when i load the 1st page of the table (i.e: 10 records) it works fine. but when I either sort it or go to any other page using the pagination it stops working. the popup does not come up at all. I also just tried with an alert. Even that does not work. I then figured out that if I comment out $(this).trigger("appendCache") popup works all fine. but my table displays all the rows. Pagination goes for a toss. Can someone please help me o开发者_运维技巧n this?
Many thanks, Racky
You probably need to assign your show-the-div logic using .live()
, which will attach the behavior to objects that are added dynamically to the page (like new table rows appearing as a result of pagination).
So something like this:
$(document).ready( function(){
$('table#your_table td').live('click', function(){
// your popup code
});
});
精彩评论