I can't believe this is so hard.
Sorter works when default.preset and tablesorter.jquery have the default code:
$(document).ready(function()
{
$("#referenssitaulukko").tablesorter();
}
);
</script>
where referenssitaulukko is the id of the table.
My table has the same id and class=tablesorter.
But how to add the pager?
1. I took the example pager-div from this page
http://www.novell.com/communities/node/8797/jquery-tablesorter-pagination-and-sorting-made-simple :
<div id="pager" class="pager">
<form>
<img src="images/first.png" class="first"/>
<img src="images/prev.png" class="prev"/>
<input type="text" class="pagedisplay"/>
<img src="images/next.png" class="next"/>
<img src="images/last.png" class="last"/>
<select class="pagesize">
<option value="">>LIMIT</option>
<option value="2">2 per page</option>
<option value="5">5 per page</option>
<option value="10">10 per page</option>
</select>
</form>
</div>
I added this to the bottom of my page.
2. Same page has also the correct code to load pager:
$(document).ready(function()
{
$("#insured_list")
.tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
}
);
</script>
and the Script authors webpage has this:
$(document).ready(function() {
$("table")
.tablesorter({widthFixed: true, widgets: ['zebra']})
.tablesorterPager({container: $("#pager")});
});
I've tried them both. I corrected the table id (table=referenssitaulukko) and then tried to replace the default code from the default.preset and/or tablesorter.jquery with this, but it afterwards sorting dosen't work.
I guess to a person familiar with jquery this isn't a hard thing to do, but to a total amateur this seems to be...
The question is: where should I put those codes? To the default.preset, to tablesorter.jquery, both or somewhere else? This script has also a lot of extra options but I have now idea where to employ them...
Any help/tips are greatly appreciated!