Need to sort?

SortedTable allows you to make any valid table a sortable one. Tables can be sorted automatically or manually by moving rows.

Instructions

To start using SortedTable all you need is:

have a valid XHTML document,

document, have a valid table* in this document

download the following javascripts to a folder on your server: Event.js and SortedTable.js

add a class="sorted" to the table

include the javascripts in the html (<script type="text/javascript" src="Event.js"></script> and <script type="text/javascript" src="SortedTable.js"></script>)

add the following code to the html <script type="text/javascript">onload = function() {var myTable = new SortedTable();}</script>

if you're using XML Data Islands add class regroup (you should have class="sorted regroup")

This is not the only thing you can do to use this code. If you're an advanced JavaScript developer the following examples might give you some more ideas.

Since SortedTable does all it's operations on live DOM lists you can do anything with the tables and it should not break (as many other widgets do).

* You need to learn about cell attributes headers (they need to match the header cell ids) and axis (to set the compare methods).

Examples

Find out what it can do.

Documentation

Dive into the code.

Author

Author of this script is Marko Mrdjenovic.

Development

To report bugs or track development check the blog.

Support

Disclaimer

The script is available as-is and has no guarantees.

License

This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.

