> I've never seen that plugin and I would love to be introduced to it!
I wrote a pager plugin to power the http://jquery.com/api/ site. It
works with both numbers, alpha characters, and words. Additionally, it
works on <ul>, <ol>, and <table> elements (with <dl> elements in the
works). After I squish some more bugs, I'll document it and release
it. For now, however, you can find it on this page:
http://jquery.com/api/js/pager.js
I made sure that this plugin works really really fast. I tested it
against all of Christian's "large table" samples and it performs
wonderfully.
Roughly, this is how you use it:
1) If all you want is a numbered-page pager, just do:
$("ul").pager(); (or on any other ul/ol/table element)
It defaults to 10 per page, you can change that, though:
$("ul").pager(20);
2) If you want an alphanumeric pager, it's a little bit trickier:
With the structure:
<ul>
<li>Test</li>
<li>Another Test</li>
</ul>
do:
$("ul").alphaPager();
(This extracts the text contents from the text contents of each
element and gets the first character)
this gets the first word instead:
$("ul").alphaPager(0,"word");
With the structure:
<ul>
<li><b>Title:</b> Test</li>
<li><b>Title:</b> Another Test</li>
</ul>
do:
$("ul").alphaPager(1);
(This gets the Nth child element and extracts the first character from
its contents)
this does the same for a word:
$("ul").alphaPager(1,"word");
It simply handles more 'simple' use cases, for anything more complex,
you can write your own parsing function like so:
$("ul").alphaPager(function(elem){
// Must return the string that you want sorted on
return elem.firstChild.firstChild.nodeValue.substr(0,1);
});
Let me know if you have any questions concerning how it works.
--John
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/