There is the &quot;sort&quot; attribute of the dtml-in tag.&nbsp; You'll have to read the DTML Reference for more info on that.<br>
<br>
However, it was a little iffy for me once, and now I do something like this:<br>
<br>
1. Setup table header with a response back to sort that column.<br>
2. Change the ZSQL method to use that value dynamically.<br>
<br>
Maybe not the best/most efficient way, but it works great for my use.<br>
<br>
So on your table header, either add forms with submit links, or add a
link with query strings.&nbsp; I usually add a query string, so my
table header looks like this:<br>
&lt;tr&gt;<br>
&nbsp; &lt;td&gt;&lt;a href=&quot;&lt;dtml-var URL0&gt;?sortby=colA&quot;&gt;Col A&lt;/td&gt;<br>
&nbsp; &lt;td&gt;&lt;a href=&quot;&lt;dtml-var URL0&gt;?sortby=colB&quot;&gt;Col B&lt;/td&gt;<br>
&lt;/tr&gt;<br><br>
Then in your ZSQL method, setup an argument for &quot;sortby&quot;.&nbsp; Make
sure you name colA or colB exactly like your table columns.&nbsp; In
the method, I create a dtml-if at the end of the query:<br>
Select ........<br>
&lt;dtml-if &quot;_.has_key('sortby')&quot;&gt;<br>
&nbsp;&nbsp; Order by &lt;dtml-var sortby&gt;, LastName<br>
&lt;dtml-else&gt;<br>
&nbsp;&nbsp; Order by&nbsp; LastName<br>
&lt;/dtml-if&gt;<br>
<br>
OR<br>
<br>
Select ........<br>

&lt;dtml-if &quot;_.has_key('sortby')&quot;&gt;<br>

&nbsp;&nbsp; Order by &lt;dtml-var sortby&gt;<br>

&lt;/dtml-if&gt;<br>
<br>
I have LastName there because I always wanted that column to be a
second sort. You obviously would have a different one. &nbsp; There's
probably a little more to this I am not thinking of at the moment, but
I hope it helps you towards your goal.&nbsp; You could also get real
fancy and add ascending and descending to the mix. (click to sort,
click again to sort desc)<br>
<br>
Greg<br>
<br>
<br><div><span class="gmail_quote">On 10/7/05, <b class="gmail_sendername">Thomas Apostolou</b> &lt;<a href="mailto:tomatbiz-tominfo@yahoo.co.uk">tomatbiz-tominfo@yahoo.co.uk</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello all,<br>i am using the following to get some data from<br>Database<br>and show them in a table:<br><br>&lt;head&gt;<br>&lt;META HTTP-EQUIV=&quot;Content-Type&quot; CONTENT=&quot;text/html;<br>charset=ISO-8859-7&quot;&gt;
<br>&lt;/head&gt;<br>&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;&lt;!-- @import<br>url(/plone.css); --&gt;&lt;/style&gt;<br>&lt;style type=&quot;text/css&quot; media=&quot;screen&quot;&gt;&lt;!-- @import
<br>url(/ploneColumns.css); --&gt;&lt;/style&gt;<br>&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;&lt;!-- @import<br>url(/ploneCustom.css); --&gt;&lt;/style&gt;<br>&lt;dtml-var standard_html_header&gt;<br>&lt;table id=&quot;sortable&quot; class=&quot;listing&quot; summary=&quot;Content
<br>listing&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;<br>&nbsp;&nbsp;&lt;thead&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-in expr=&quot;GetHeader(sysDSN=sysDSN, usr=usr,<br>mypass=mypass, sTable=sTable)&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;th class=&quot;&quot;&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-in sequence-item&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-var sequence-item&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dtml-in&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/th&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dtml-in&gt;<br>&nbsp;&nbsp;&lt;/thead&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-in expr=&quot;GetData(sysDSN=sysDSN, usr=usr,
<br>mypass=mypass, sTable=sTable)&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-if sequence-even&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr class=&quot;even&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-else&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;tr class=&quot;odd&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dtml-if&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;dtml-in sequence-item&gt;<br>&lt;!--&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td &lt;input type=&quot;checkbox&quot; title=&lt;dtml-var<br>sequence-item&gt; &gt;&lt;/td&gt;--&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;td&gt;&lt;dtml-var sequence-item&gt;&lt;/td&gt;
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dtml-in&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/tr&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&lt;/dtml-in&gt;<br>&lt;/table&gt;<br>&lt;dtml-var standard_html_footer&gt;<br><br><br>But how can i tell the table to sort the column i<br>click on just like plone does with the members list?
<br><br>Thanks in advance<br><br>Thomas Apostolou<br><br><br><br><br><br><br>___________________________________________________________<br>Χρησιμοποιείτε Yahoo!;<br>Βαρεθήκατε τα ενοχλητικά μηνύματα (spam); Το Yahoo! Mail
<br>διαθέτει την καλύτερη δυνατή προστασία κατά των ενοχλητικών<br>μηνυμάτων <a href="http://login.yahoo.com/config/mail?.intl=gr">http://login.yahoo.com/config/mail?.intl=gr</a><br><br>_______________________________________________
<br>Zope maillist&nbsp;&nbsp;-&nbsp;&nbsp;<a href="mailto:Zope@zope.org">Zope@zope.org</a><br><a href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</a><br>**&nbsp;&nbsp; No cross posts or HTML encoding!&nbsp;&nbsp;**<br>
(Related lists -<br> <a href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a><br> <a href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev
</a> )<br></blockquote></div><br><br clear="all"><br>-- <br>Greg Fischer<br>1st Byte Solutions<br><a href="http://www.1stbyte.com">http://www.1stbyte.com</a>