[pmwiki-users] Sortable tables
DaveG
pmwiki at solidgone.com
Sat Apr 28 22:33:15 CDT 2007
I'm partial to the jQuery javascript library, so I'd use this:
http://motherrussia.polyester.se/docs/tablesorter/
You tell it which table to allow to be sorted by specifying it's ID, or
class. (There are numerous other ways, but these are the easiest for
now.) Thus, we can allow sorting on more than one table on a page. The
routine will provide sorting on all columns in the table.
What we need to do is create a pmwiki syntax that will provide all the
parameters usable by the javascript call. Then we include the jQuery
library in the page header, and make the call when the document is ready.
The routine can acceot a number of parameters, but probably the most
relevant for us:
sortDir: 0,
sortColumn: null,
sortClassAsc: 'ascending',
sortClassDesc: 'descending',
headerClass: null,
stripingRowClass: false,
highlightClass: false,
stripeRowsOnStartUp: false,
dateFormat: 'mm/dd/yyyy' /** us default, uk dd/mm/yyyy */
So, a syntax like this might work reasonably well. We can include that
once in a page.
(:sorttable targetid=xxx targetclass=yyy sortdir=0 sortcolumn="ddd",
...... :)
Well need to code up:
1] something to parse the syntax above into a javascript call
2] something to add the $(document).ready call, using [1] in the page
<head> tag.
I'll try to knock something up tomorrow.
~ ~ Dave
Donald Z. Osborn wrote:
> Thanks Dave, it is a single page - or will be (still putting it
> together). less than 60 rows.
>
> I'd be interested to know what's involved and how easy it is to set up
> (such tables can be useful in many contexts).
>
> Don
>
> On 4/28/07, *DaveG* <pmwiki at solidgone.com <mailto:pmwiki at solidgone.com>>
> wrote:
>
> If you tables fit onto a single page (ie, not paginated) I can implement
> a client-side solution pretty easily.
>
> ~ ~ Dave
>
> Donald Z. Osborn wrote:
> > I'm interested in implementing a sortable table. Noted that this has
> > been discussed at http://www.pmwiki.com/wiki/PITS/00388 . Is there
> > anything new?
> >
> > TIA... Don
> >
> >
> >
> ------------------------------------------------------------------------
>
> >
> > _______________________________________________
> > pmwiki-users mailing list
> > pmwiki-users at pmichaud.com <mailto:pmwiki-users at pmichaud.com>
> > http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
>
More information about the pmwiki-users
mailing list