Filtered wiki tables #

Introduction#

Add a %%table-filter JSPWikiStyle around your table to get EXCEL-like column filters. Each column gets a dropdown with a sorted list of filterable values. Multiple filter selections are supported too.

See also Sortable Tables -- First apperared in BrushedTemplate Jan 06, added to JSPWiki since v2.5.xx. DF, Sep 07.

Usage#

Enclose your table in %%table-filter tags.
Your table is assumed to start with a header row. When all is fine, you should see an additional table row with filter dropdowns for each column.

%%table-filter
|| Title || Author || Published   || Edition || Some IP@
| book1  |  zappy  |  25 Feb 2005 |  5       |  100.100.100.100
| book2  |  dappy  |  25 Jan 2005 |  19      |  256.100.100.100
| book3  |  pappy  |  23 Mar 2005 |  06      |  10.100.100.100
| book4  |  dappy  |  21 Apr 2005 |  199     |  1.100.100.100
| book5  |  rappy  |  25 Jul 2005 |  06      |  1.100.25.100
/%

Reality check:

Title Author Published Edition Some IP@
book1 zappy 25 Feb 2005 5 100.100.100.100
book2 dappy 25 Jan 2005 19 256.100.100.100
book3 pappy 23 Mar 2005 06 10.100.100.100
book4 dappy 21 Apr 2005 199 1.100.100.100
book5 rappy 25 Jul 2005 06 1.100.25.100
Title Author Published Edition Some IP@
book1 zappy 25 Feb 2005 5 100.100.100.100
book2 dappy 25 Jan 2005 19 256.100.100.100
book3 pappy 23 Mar 2005 06 10.100.100.100
book4 dappy 21 Apr 2005 199 1.100.100.100
book5 dappy 25 Jul 2005 06 1.100.25.100

Implementation#

The implementation was inspired by the work of WoutL on http://www.codeproject.com/jscript/filter.asp. Tx for the suggestion by Nascif Abousalh Neto -- 19-Jan-2006

Some rework was done, so it also runs on Safari, and does proper sorting depending on the data type of the column.


Is there anyway to somehow adjust the width of table? I noticed that when I choose to use table-filter, width of the table just explodes. Even %%(width:950px) seem to not help at all.

--AnonymousCoward, 09-heinä-2009 13:24


Similarly to the SortableTable, the Author and Title columns don't sort correctly and they don't work at all in IE v6 and v7.

--AndrasBalogh

This sorting issue has been fixed in 2.8.3-svn-11. --DF

How can I exclude some columns from filtering? AnswerMe --pihentagy
You can't. When a column contains only 1 value, no filter dropdown will be shown - DF

Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
jpg
vanilla-tablefilter1.jpg 18.5 kB 1 25-Jan-2006 21:36 DirkFrederickx
jpg
vanilla-tablefilter2.jpg 11.3 kB 1 25-Jan-2006 21:36 DirkFrederickx
« This page (revision-35) was last changed on 05-Jul-2012 22:11 by 109.132.174.135