DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sortablejs

This is an old revision of the document!


sortablejs Plugin

—- plugin —- description: JavaScript for sortable tables author : vaxquis email : spamove@gmail.com type : syntax compatible : anteater, angua, Rincewind, adora belle, Weatherwax, Binky, 2014-05-05 “Ponder Stibbons”, 2014-09-29 “Hrun” depends : conflicts : cellbg similar : tags : javascript, tables, sort, listing downloadurl: https://github.com/oiv/sortablejs/zipball/master sourcerepo : https://github.com/oiv/sortablejs bugtracker : https://github.com/oiv/sortablejs/issues

Description

This plugin adds a JavaScript, which can be used to create sortable tables in other plugins. It is optional for linkmanager plugin.

Usage

After installing the plugin you should make sure that your DokuWiki cache is updated. This can easily be done by changing any parameter value in settings (or by doing a touch conf/local.php).

You need to set <sortable> and </sortable> tags around your table.

<sortable>
^Col1^Col3^Col3^
|1|one|25/12/2008|
|2|two|10/12/2008|
</sortable>

Table initially sorted by column 1

<sortable 1>
^Col1^Col3^Col3^
|1|one|25/12/2008|
|2|two|10/12/2008|
</sortable>

Table initially reverse sorted by column 1

<sortable r1>
^Col1^Col3^Col3^
|1|one|25/12/2008|
|2|two|10/12/2008|
</sortable>

To sort the columns you (the page viewer) just needs to click on the correct column on the first row. A second click on the same column reverses sort.

Options

<sortable [[r]column] [sumrow[=2]] [column=alpha|numeric|ddmm|mmdd|nosort] [3phase]>

  <sortable r1 sumrow=2 3phase 1=numeric 2=alpha 3=nosort>
            ││   │        │         │       │      │
            ││   │        │         │       │      └ No sort option for column 3
            ││   │        │         │       └ Sort column 2 as text always
            ││   │        │         └ Sort column 1 as numeric always
            ││   │        └ Add a 3 phase sort option. Normal, Reverse and Back to original order.
            ││   └ Prevent last 2 rows from sort. The number can be omitted. Default is last row (=1)
            │└ Initially sort by column 1 on page load
            └ Reverse initial sort

Older versions

Known bugs

plugin/sortablejs.1464290518.txt.gz · Last modified: 2016-05-26 21:21 by vaxquis