[Zope] sorting in dtml-in
Marie Robichon
robichon@esrf.fr
Fri, 16 May 2003 16:29:08 +0200
I have a table generated from a database that I want to be able to sort by
different criteria by clicking on the column headers and reloading the
page, however I have tried various syntaxes for the <dtml-in
selectAllProjects sort=....> line, and although the table rows are shifted
around it doesn't seem to follo any logic. Could someone explain the
correct syntax to me please?
I tried :
<dtml-in selectAllProjects sort='<dtml-var sortby missing="">'>
also tried doing a <dtml-call "REQUEST.set('sortby', sortby)"> with
<dtml-in selectAllProjects sort=sortby> but have probably got the
REQUEST.set stuff wrong too.
Here's the table
<table border="1" width="100%">
<tr>
<td><a href="BE?sortby=responsible">Responsible</a></td>
<td><a href="BE?sortby=beamline">BL#</a></td>
<td><a href="BE?sortby=project_title">Title</a></td>
<td><a href="BE?sortby=project_description">Description</a></td>
<td><a href="BE?sortby=status">Status</a></td>
<td><a href="BE?sortby=installdate">Install date</a></td>
<td><a href="BE?sortby=updated">Updated on</a></td>
</tr>
<dtml-in selectAllProjects sort=????>
<tr>
<td><dtml-var responsible></td>
<td><dtml-var beamline></td>
TIA
Marie Robichon
Web Task Force
European Synchrotron Radiation Facility
BP 220
38043 Grenoble Cedex
France
http://www.esrf.fr
Tel: (33) 04 76 88 21 86
Fax: (33) 04 76 88 24 27