Sorting columns in a table
I want to present the search result as the following: If the user clicks on a button (or a link) in the header, the data will be sorted according to the value of that particular variable. How could I accomplish this? (The following table is dummy. Please do not click the sorting link).
You can create different links for different sorting functions by specifying the database, the layout, the action, the sorting order,and so on. The following is an example for sorting the Item ID field in a descending order. It is important to note that the whole thing must be in one line. I put them in different lines just for clarity.
The meanings of the preceding code is explained in the following:
Specify the server's URL and the folder in which you store the SearchResults.html
Specify the name of the database
Specify the page to display after sorting. Usually it should be the same page in which the table is displayed.
Specify the layout name from which the database pulls data.
Specify how many records you want to display at once.
Specify that the field to be sorted is ItemID
Specify the comparison operator as "equal"
Specify the action as "find"You can repeat the same procedure to create sorting links for other fields.
FMP Tips Contents