views:

159

answers:

1

Hi, 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 on this?

Many thanks, Racky

+1  A: 

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
    });
});
Ken Redler
Hey Ken, That fixed my problem and saved my many hours. I appreciate your time and super knowledge. This was a preloaded table and the rest of the pages are being hidden(cashed) by the paginator plugin.@Josh: I would have posted the code if Ken hadn't replied. I will do it next time onwards. Thanks for your response.Many thanks,Racky
racky
You should probably accept his comment if it fixed your problem ;)
Organiccat