I have my tablesorter with zebra up and running just fine but I can't seem to install the pager properly.
When I include the pager.js file like you see below, it breaks my sorting all together. The sorting works fine when this file is not loaded but I get no pager.
Someone, what am I doing wrong?
<script type="text/javascript" src="/site_media/jquery.js"></script>
<script type="text/javascript" src="/site_media/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="/site_media/tablesorter/jquery.tablesorter.pager.js"></script>
<script type="text/javascript">
$(document).ready(function() {
// results table开发者_如何转开发 sorting
$("#results")
.tablesorter({widgets: ['zebra']})
.tablesorterPager({container: $("#pager")
});
});
</script>
What you put as code should work.
$("#"+tableid)
.tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
Make sure -
- You have your table with the same 'id' and pager container with same 'id'!
- Also sometimes javascript might be running before the table is completely rendered. So put javascripts at the end of the page.
Hope this helps...
精彩评论