[Zope] sorting in dtml-in

Kevin Carlson khcarlso@bellsouth.net
Fri, 16 May 2003 14:01:33 -0400


http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/AdvDTML.stx

Near the bottom of the page there is an example that shows how to do 
what you need.

Marie Robichon wrote:

> 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
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>