How to order columns using Chronoforms

peterswa62 25 Oct, 2012
Hi. I am planning on having an ability to order columns in a table by clicking on the column header once to sort them in DESC order and again to sort them in ASC order. I have looked at a code example in pure PHP, whereby you have 2 hidden fields:- one to store the column name that has to be sorted and has been clicked, the other the direction of the sort then combine these in the ORDER BY clause to pull rows from the correct order from the table. I am wondering how to translate this but using Chronoforms. Is it possible to use a variable in the WHERE clause of DB Record Loader to sort the records?
GreyHead 25 Oct, 2012
Hi peterswa62,

I'm pretty sure that you can add an ORDER BY clause in the WHERE box provided that there is a 'where' clause in front of it. Id you don't have a where clause use 1 = 1 or something else that is always true.

Bob

Bob
This topic is locked and no more replies can be posted.