Personal tools
You are here: Home Domain Plone Sortable Tables in Javascript
Document Actions

Sortable Tables in Javascript

by Perry Kundert last modified 2006-05-12 07:03

Plone provides methods for making tables sortable in the browser, using Javascript.

Instructions

A good set of instructions on how to do sortable tables in Plone is available here:

http://plone.org/documentation/tutorial/making-tables-sortable

Fixing up Plone 2.1

Here is a sortable table in Plone.  Click on the headings:

Numbers
Text
Values
One
This is
123
Two
a 7.86
Three test of the
4.56
Four sorting of
999
Five tables in Javascript
.0001
To get this to work, you need to fix up a misconfiguration in Plone's "Safe HTML" transformation.  It kills <thead> entries in <table>, which are required for the sorting Javascript to work.

Go to your Zope Management console for your Plone instance, and go to portal_transforms->safe_html->valid_tags.  In there, add 'thead' and '1' to the table of valid HTML.  After you save it, restart your zope.  You should have sortable tables!


Non-Plone implement

To do this outside of plone, you'll have to load your own javascript:

http://kryogenix.org/code/browser/sorttable/


Site by Sunflower Graphics
Powered by Plone, the Open Source Content Management System

This site conforms to the following standards: