Accessing the whole table when using the tablesorter and tablesorterPager jQuery plugin
I am using the tablesorter and tablesorterpager plugin and I really like it. http://tablesorter.com/docs/ http://tablesorter.com/docs/example-pager.html
However I need help with a problem I have. I use checkboxes for every row in a table for selecting items. I also have a “select all” checkbox in the table header. When looking at the pager script I understand that the plugin completely removes all the table rows from the DOM and only renders the visible rows, the rest of the table is cached.
So when using code similar to this:
$("#theTable").fi开发者_开发百科nd("input[name='cbitems']:not(:disabled)").each(
I will only get elements currently visible. Not elements in "hidden" pages.
So my question is; is there anyway to make the cached table accessible? For example:
$("#theTable").cachedTable.find("input[name='cbitems']:not(:disabled)").each(
I have tried reading up on object oriented javascript (or what to call it), but no success.
To answer my own question:
The cached table is accesible, I had just left out the [0] part.
$($("#theTable")[0].config.rowsCopy).each(function() {
$(this).find("input[name='nodeitems']:not(:disabled)").attr('checked', check);
});
精彩评论