https://bugzilla.wikimedia.org/show_bug.cgi?id=31332

Krinkle <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
          Component|Resource Loader             |Javascript

--- Comment #1 from Krinkle <[email protected]> 2011-10-12 02:31:22 UTC ---
When permalinks are wanted we usually let the table be built with the
TablePager class, which provides server-side sortability for (single or
multi-page) tables. It uses query parameters in the URL to trigger which column
to sort and in which direction to sort it.

In JavaScript in general, and especially in jquery.tablesorter this would be
kinda akward to implement. The problem starts at identifying which table is
meant (since there can be multiple table.sortable elements on an article). Then
how to identify which column ? Refer by number ?

Currently for the on-page state an incrementing number is used to differentiate
between different tables etc. however these are only to be used within a state,
not in URLs to new instances/loads of the article as the numbers are likely not
the same (there could be an additional table, or tables re-ordered, merged,
moved etc. there is no reliable ID.


Taking that the given example is a table outputted by a MediaWiki (PHP)
extension, and not wikitext. Using TablePager (or a variation on it that allows
GET parameters to handle the sorting) should be do-able.

Alternatively you could implement a few lines of JavaScript as part of the
Translate-extension listening to a value in location.hash when the page is
loaded and trigger a sort. Again, I suggest to do this inside the special page
or extension instead of in jquery.tablesorter as jquery.tablesorter is
primarily meant for articles and needs to support multiple tables per-page.

Something with $(document).ready, window.location.hash and $(find table) using
$.fn.tablesorter or $.fn.click or $.fn.attr to somehow force an initial sort.

--
Moving from component ResourceLoader to JavaScript (related to the
jquery.tablesorter module)

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to