DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tablefilterjs

This is an old revision of the document!


tablefilterjs Plugin

Compatible with DokuWiki

"Weatherwax" "Angua" "Adora Belle"

plugin Filter DokuWiki table using JavaScript regexps.

Last updated on
2013-06-17
Provides
Syntax
Repository
Source

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Tagged with filter, javascript, tables

I'm a young student working on this plugin in my free time. So if you like this plugin you can Flattr it on its github page or send me money via PayPal. There is a lot to do in this plugin and a small donation would convince me that you need my work and motivate me to keep developing this plugin. Thank you in advance. ;-)

Description

This plugin allows you to filter rows in your dokuwiki table by using javascript regex. The plugin is much more useful with include plugin which allows you to have one page where you store your data and several others where you store filtered informations.

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Examples/Usage

Let's say that we have table that contains names and birth's date and we want to know who was born in 08-11-1994:

<filter Birthday=/08-11-1994/>
^Name^Birthday^
|User 1|12-12-1995|
|User 2|08-11-1994|
|User 3|18-12-1994|
</filter>

or more briefly(using cols index instead of names).

<filter 2=/08-11-1994/>
^Name^Birthday^
|User 1|12-12-1995|
|User 2|08-11-1994|
|User 3|18-12-1994|
</filter>

This will return only the second row.

Now let's try something more complexed. For example select all persons born in 1994:

<filter 2=/\d{1,2}-\d{1,2}-1994/>
^Name^Birthday^
|User 1|12-12-1995|
|User 2|08-11-1994|
|User 3|18-12-1994|
</filter>

Here we've used javascript regexp syntax. You can read more about it here.

Using tablefilterjs with include

As I've mentioned before this plugin is mostly useful when used together with include plugin. You can read more about this plugin on it's page but there are several things to remember when you want to use it together with tablefilterjs. To use dokuwiki table nested by include on one of your page. Use following syntax:

<filter "Data"=/201[0-9]{1}/>
{{page>test&inline}}
</filter>

Remeber about adding inline flag. Without it tablefilterjs will simply not work. There are also several other include flags that you may consider usefull:

<filter "Data"=/201[0-9]{1}/>
{{page>test&inline&nofooter&noeditbutton&noheader}}
</filter>

This flags cause that only the source table will be shown, without unnecessary(headers, footers, edit buttons).

Syntax

There are two variants of syntax. First allows you to use table headers as row names that will be used to filter table. Ex.:

<filter "Test row"=/test/>
</filter>

If your header contains “ you can use ' instead. Ex.

<filter 'Test "something" row'=/test/>
</filter>

Alternativelly you can use \ char in order to quote ' or ”:

<filter 'Test \'something\' row'=/test/>
</filter>

Instead of using headers you can use headers numbers(1 means first column):

<filter 1=/another test/ 2=/something more/>
</filter>

You can of course mix this two syntax variants:

<filter 1=/another test/ "Test row"=/test/>
</filter>

After = you need to put JavaScript compatibile regexp between / / characters. After second / you can set regexp flags. For example:

<filter 1=/another test/i>
</filter>

Configuration and Settings

The plugin doesn't have any configuration options.

Development

Change Log

Known Bugs and Issues

Please report bug and issus on the project's github page.

ToDo/Wish List

If you have any wishes write it down here.

FAQ

Discussion

This plugin turns off Indexmenu plugin! :!: 2013-06-21 (Rolew) Fixed.

  • :!: This plugin breaks the Table of Contents on “Blinky”! (2014-01-10)
  • I cannot reproduce it. Can you give me your use case which cause “Table of Contonts” break.(which template do you use? How do you use tablefilterjs(with include or not)? etc.) — Szymon Olewniczak 2014/02/05 09:37
plugin/tablefilterjs.1391589484.txt.gz · Last modified: 2014-02-05 09:38 by freesz

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki