#Sortable tables

3 messages · Page 1 of 1 (latest)

cloud salmon
#

Following up on some posts I made in #general, I'm trying to construct a sortable table (via a lua module). I have a separate date display that does not conform to what mediawiki's date sorting expects (I would really like to have the weekday displayed), and this is throwing the sorting off. I am trying to then use data-sort-value and data-sort-type to amend this, but this doesn't seem to be working either. See Challenge time header:
https://outlanders.miraheze.org/wiki/Main_Page
last pic: an example I am comparing with from the Sortable tables help page

Outlanders
MediaWiki

To make a sortable table, add the sortable class to a table.
This class adds arrows displayed beside the header within each header cell.
(See example below.)
When you click on an arrow, the table rows are arranged according to the chosen column.
Continuously clicking the arrow alters the sorting order in the following pattern: Ascending (min to...

jade monolith
#

i believe this is because FilterTable uses DataTables for filtering. if you change data-sort-value to either data-sort or data-order (from the DataTables documentation) that should fix the sorting

if that doesn't work, you can try adding <span style="display:none;">sortkey</span> before your data

cloud salmon
#

Yes that works! it was indeed data-sort, makes sense now. Thanks!