We have an application that allows users to search through some models. The search results are loaded into a table that uses tabIesorter and the pager plugin. The use can page, sort, etc.. through the search results and all of that works fine.
We are also using the jQuery Address plug-in to save state and make the back and forward buttons work properly. Users are able to click on a link in the table of search results, which brings up a modal dialog with the model details. When that happens, we are caching the search results table. This enables the user to click the "back" button, which closes the modal window and re-displays the search results table.
The problem we are having is with caching the search results table. When the user clicks on the link to load the model details, we cache the search results table like so:
var content = jQuery(this).clone();
We stick content into a cache variable. When the user clicks the "back" button, we pull that same content out of cache and do this to set it back:
jQuery("#cmlSearch_container").html(content);
When we do this, if there was more than one page of search results, we are losing the other pages. For example, if the user's search orignially returned 50 results and they were showing ten results per page, there were 5 pages. When they view the details and click the back button however, there is only 1 page.
Essentially, what I think we need to know is how to cache the tablesorter's cache. It seems like it is not getting cached when we use jQuery(this).clone(); I have explored the pager plug-in code and I don't see where it is caching things. I don't believe using $('#myTable').trigger("update"); is going to work in this case, as we have lost the cache somehow.
Help and thanks!