The two most common solutions to this are:
- You re-submit your query whenever the user requests a different sort order. This method is very clean, but may not be efficient in situations where the query is very resource intensive.
- You store the results of your query to a temporary table, index it based on all possible sort orders and save its name in a session variable, or pass it to the browser as a hidden form field. Whenever the user requests a different sort order, you reopen the table, select the appropriate index and reconstruct your list. The problem with this method is that you have to clean-up all temporary tables at regular intervals to prevent your disk from filling up.
Another possibility is to use the XML API to sort the table on the browser side, but this is a pretty advanced solution and is browser-specific.
FoxWeb Support Team support@foxweb.com email |
Sent by Ramon Agui on 06/09/2003 10:21:58 AM:
hi, i'm new to foxweb and i'm looking for help.
i have 5 column query result coming out from multiple tables and post it to a page. but i'm figuring out how to sort this result dynamically as per user selection per column. the instance of foxpro is gone and the temp is gone too. of course i don't need to repeat the query back and forth just to change the order.
can anyone help me pls?