Question
My problem: I have a page of "new people"" in the department. People are added as they join. Each person has a section and there is a table of contents, but the TOC is in order of joining.
I would like to view the TOC in alphabetical order. As long as I'm at it, I might as well look for a generalizable solution that can sort any bullet list.
I looked at
SpreadSheetPlugin but the sort functions want table cells. No tables here.
I figured
JavaScript could solve the problem.
Environment
--
VickiBrown - 06 Jul 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
I did a web search for
JavaScript that sorts lists and found a very promising script written by Bruno Bornsztein (blog.feedmarker.com). I ran into a few oddities - such as the fact that TWiki TOCs don't have a unique ID :-( but they do have a unique class :-) (providing, of course, that there is only one TOC on the page!)
I modified the JS to handle classes and got it working. You can see the results
on my TWiki page
.
The Javascript code is attached:
list_sort.js
--
VickiBrown - 06 Jul 2008
Have a look at
FilterPlugin. Its FORMATLIST might fit your needs.
--
MichaelDaum - 07 Jul 2008