DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:sortablejs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:sortablejs [2016-05-26 21:23] vaxquisplugin:sortablejs [2024-02-08 09:11] (current) LMS23
Line 3: Line 3:
 ---- plugin ---- ---- plugin ----
 description: JavaScript for sortable tables description: JavaScript for sortable tables
-author     : vaxquis+author     : vaxquis (AKA FyiurAmron)
 email      : spamove@gmail.com email      : spamove@gmail.com
 type       : syntax type       : syntax
-compatible : anteaterangua, Rincewind, adora belle, Weatherwax, Binky, 2014-05-05 "Ponder Stibbons", 2014-09-29 "Hrun" +lastupdate : 2023-04-12 
 +compatible : AnteaterAngua, Rincewind, "Adora Belle", Weatherwax, Binky, "Ponder Stibbons", Hrun"Elenor Of Tsort", Greebo, Hogfather; Igor, Jack Jackrum, Kaos
 depends    : depends    :
-conflicts  : cellbg +conflicts  : cellbg, tabinclude 
-similar    :+similar    : datatables, tablelayout
 tags       : javascript, tables, sort, listing tags       : javascript, tables, sort, listing
-downloadurl: https://github.com/oiv/sortablejs/zipball/master +downloadurl: https://github.com/FyiurAmron/sortablejs/zipball/master 
-sourcerepo : https://github.com/oiv/sortablejs +sourcerepo : https://github.com/FyiurAmron/sortablejs 
-bugtracker : https://github.com/oiv/sortablejs/issues+bugtracker : https://github.com/FyiurAmron/sortablejs/issues
 ---- ----
  
 ===== Description ===== ===== Description =====
  
-This plugin adds a JavaScript, which can be used to create sortable tables in other plugins. It is optional for [[linkmanager]] plugin.+JavaScript-based (client-side) plugin, which can be used to create sortable tables. It is optional for [[linkmanager]] plugin.  
 + 
 +For server-side sorting or more robust sort facilities use Sam Wilson's sorter, based on https://github.com/Mottie/tablesorter (supports server-side sorting): https://github.com/samwilson/dokuwiki_sortablejs 
 + 
 +Previously maintained by oiv (Otto Vainio at otto@valjakko.net)
  
 ===== Usage ===== ===== Usage =====
Line 28: Line 33:
 <code> <code>
 <sortable> <sortable>
-^Col1^Col3^Col3^ + Col1   Col3   Col3      
-|1|one|25/12/2008| +     | one    02/25/2008 | 
-|2|two|10/12/2008|+     | two    02/14/2008 |
 </sortable> </sortable>
 </code> </code>
Line 37: Line 42:
 <code> <code>
 <sortable 1> <sortable 1>
-^Col1^Col3^Col3^ + Col1   Col3   Col3      
-|1|one|25/12/2008| +     | one    02/25/2008 | 
-|2|two|10/12/2008|+     | two    02/14/2008 |
 </sortable> </sortable>
 </code> </code>
Line 46: Line 51:
 <code> <code>
 <sortable r1> <sortable r1>
-^Col1^Col3^Col3^ + Col1   Col3   Col3      
-|1|one|25/12/2008| +     | one    | 2008-02-25 
-|2|two|10/12/2008|+     | two    | 2008-02-14 |
 </sortable> </sortable>
 </code> </code>
Line 57: Line 62:
  
 <code> <code>
-<sortable [[r]column] [sumrow[=2]] [column=alpha|numeric|ddmm|mmdd|nosort] [3phase]>+<sortable [[r]column] [sumrow[=2]] [column=alpha|numeric|date|nosort] [3phase]>
  
   <sortable r1 sumrow=2 3phase 1=numeric 2=alpha 3=nosort>   <sortable r1 sumrow=2 3phase 1=numeric 2=alpha 3=nosort>
Line 64: Line 69:
             ││   │        │         │       └ Sort column 2 as text always             ││   │        │         │       └ Sort column 2 as text always
             ││   │        │         └ Sort column 1 as numeric always             ││   │        │         └ Sort column 1 as numeric always
-            ││   │        └ Add a 3 phase sort option. Normal, Reverse and Back to original order.+            ││   │        └ 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)             ││   └ Prevent last 2 rows from sort. The number can be omitted. Default is last row (=1)
             │└ Initially sort by column 1 on page load             │└ Initially sort by column 1 on page load
             └ Reverse initial sort             └ Reverse initial sort
 </code> </code>
-==== Misc links ==== 
-historical versions: https://github.com/FyiurAmron/sortablejs/wiki/older-versions 
  
-GitHub revision history: https://github.com/FyiurAmron/sortablejs/commits/master+Columns sorted as special data types 
 +<code> 
 +<sortable 1=alpha 2=date 3=numeric 4=numeric 5=nosort> 
 +^ Col1 ^  Col3      ^ Col3 ^  Col4    Col5   ^ 
 +| one  | 02/25/2008 | 34°C |  € 23,42| 205-8795| 
 +| two  | 02/14/2008 | 12°C | € 193,54| 442-0026| 
 +</sortable> 
 +</code> 
 + 
 +Date type is sorted, if, e.g. US american date format mm/dd/yyyy is used. The date sorting is done via //Date()// object, which, in theory, should work like this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format 
 + 
 +In practice, it usually accepts legacy formats (based on browser etc.), e.g.: 
 +  * mm-dd-yyyy 
 +  * yyyy/mm/dd 
 +  * mm/dd/yyyy 
 +  * mmmm dd, yyyy 
 +  * mmm dd, yyyy 
 +Of course, the format yyyy-mm-dd will always be correctly sorted, when labeled as //alpha// and even if not labeled at all. 
 + 
 +The implementation of type numeric is capable of cutting off units before and after numeric values. This makes it efficient to sort e.g. prices and temperature values with units attached.
  
-historical bugs/ehnancements: https://github.com/FyiurAmron/sortablejs/wiki/old-issues-%26-enhancement-requests+===== Misc links =====
  
-current issue tracker: https://github.com/FyiurAmron/sortablejs/issues+  * Historical versions: https://github.com/FyiurAmron/sortablejs/wiki/older-versions 
 +  * GitHub revision history: https://github.com/FyiurAmron/sortablejs/commits/master 
 +  * Historical bugs/ehnancements: https://github.com/FyiurAmron/sortablejs/wiki/old-issues-and-enhancement-requests 
 +  * current issue tracker: https://github.com/FyiurAmron/sortablejs/issues
plugin/sortablejs.1464290620.txt.gz · Last modified: 2016-05-26 21:23 by vaxquis

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