On 10 août, 12:52, agent2026 <[EMAIL PROTECTED]> wrote:
> This undocumented plugin is really worth adding to the repository I
> think. It needs a little fleshing out, which I've tried to do, but
> all in all is a super fast, super easy to implement pager.
>
> I've modified it with spread (how many pages to either side of your
> current page will show in the navigation) and nonNumerical arguments
> (whether to show page numbers or not) to make it a bit more versatile.
>
> I've come across one problem though, which I hope someone can figure
> out. If the number if line items per page (step) is divisible equally
> into the total number of line items, I end up with a 'phantom' empty
> page at the end. For example, if my line item limit is set to 10
> ( ul.pager(10) ), and I have 30 line items in total, the pager will
> produce 4 pages instead of 3 with the 4th page being empty
> (nonNumerical setting makes no difference). I could hack it away of
> course, but I 'd really like to know why this happens. The bug is
> present in the original too,http://jquery.com/api/js/pager.js.
>
> As far as I can see there's no way to upload files in Ggroups, so it's
> all below.
>
> Adam
Cool, thanx Adam for the tip.
I didn't know of this plugin before you talked about it, it's a really
useful one.
Make it a widget for table sorter v2, and you have exactly the thing I
need :
Add this to pager.js :
/* Create widget for tablesorter */
if ($.tablesorter != undefined){
$.tablesorter.addWidget({
id: 'pager',
format: function(table) {
$(table).pager();
}
});
};
And use it like this :
$("table").tablesorter({
widgets: ["zebra", "pager"]
});
Really simple, and once more, really useful.
Tcho
__
Romain