There is the "sort" attribute of the dtml-in tag. 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. I usually add a query string, so my
table header looks like this:<br>
<tr><br>
<td><a href="<dtml-var URL0>?sortby=colA">Col A</td><br>
<td><a href="<dtml-var URL0>?sortby=colB">Col B</td><br>
</tr><br><br>
Then in your ZSQL method, setup an argument for "sortby". Make
sure you name colA or colB exactly like your table columns. In
the method, I create a dtml-if at the end of the query:<br>
Select ........<br>
<dtml-if "_.has_key('sortby')"><br>
Order by <dtml-var sortby>, LastName<br>
<dtml-else><br>
Order by LastName<br>
</dtml-if><br>
<br>
OR<br>
<br>
Select ........<br>
<dtml-if "_.has_key('sortby')"><br>
Order by <dtml-var sortby><br>
</dtml-if><br>
<br>
I have LastName there because I always wanted that column to be a
second sort. You obviously would have a different one. 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. 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> <<a href="mailto:tomatbiz-tominfo@yahoo.co.uk">tomatbiz-tominfo@yahoo.co.uk</a>> 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><head><br><META HTTP-EQUIV="Content-Type" CONTENT="text/html;<br>charset=ISO-8859-7">
<br></head><br><style type="text/css" media="screen"><!-- @import<br>url(/plone.css); --></style><br><style type="text/css" media="screen"><!-- @import
<br>url(/ploneColumns.css); --></style><br><style type="text/css" media="all"><!-- @import<br>url(/ploneCustom.css); --></style><br><dtml-var standard_html_header><br><table id="sortable" class="listing" summary="Content
<br>listing" cellpadding="0" cellspacing="0"><br> <thead><br> <dtml-in expr="GetHeader(sysDSN=sysDSN, usr=usr,<br>mypass=mypass, sTable=sTable)"><br> <th class="">
<br> <dtml-in sequence-item><br> <dtml-var sequence-item><br> </dtml-in><br> </th><br> </dtml-in><br> </thead><br> <dtml-in expr="GetData(sysDSN=sysDSN, usr=usr,
<br>mypass=mypass, sTable=sTable)"><br> <dtml-if sequence-even><br> <tr class="even"><br> <dtml-else><br> <tr class="odd"><br> </dtml-if>
<br> <dtml-in sequence-item><br><!-- <td <input type="checkbox" title=<dtml-var<br>sequence-item> ></td>--><br> <td><dtml-var sequence-item></td>
<br> </dtml-in><br> </tr><br> </dtml-in><br></table><br><dtml-var standard_html_footer><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 - <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>** No cross posts or HTML encoding! **<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>