Token: Sort

By

Sorting your results by utilizing the built in syntax provided for controlling not only the rendered data order, but also for dynamically modifying the standard, ascending and descending display headers is easy with our syntax specification. All runtime actions like Sorting, Interactive Lists and Actions utilize the similar formatting structures contained within curly braces {...}. The Sort syntax requires seven parameters. The Type of the action - SORT, the name of the column used in the sort, the Standard display formatting, the Ascending display formatting, the Descending display formatting, the default order (ASC,DESC or nothing), and the Index of the Sort relative to the list. The sort Index is used to replace the occurrence(s) of any {SORTHEADER,Index} tag where the Index would be the Sort Index contained in the sort tag.

Tip: The output functionality examines the resulting table from your query and replaces occurrences of the Column Values with those identified in your table. If you are having trouble diagnosing occurrences of Column Names not effectively replacing, turn the debug feature on and take a look at names of the columns. The names of these columns are dire to the success of your sorting mechanisms - so double check those columns, and take a look at the actual values stored within the sort tag.

Sorting Syntax

Sorting handlers are made up of a pair of syntax element. The first provides the ability to identify the structure of the actual sorting configuration and handles all of the sort parameters including the sort index. The second is simply a placeholder for the output of the sort configuration called the Sort header. The sort configuration element will render a formulated HREF tag which is required for Anchor tag elements. The action tag will execute a javascript function built in to ListX, so the SORT element should always occur within an ANCHOR tag. The SORTHEADER tag would then be placed as the contents of the ANCHOR.

The sorting is a three click approach, iterating through the options of none, ascending and descending upon each click from the mouse.

Sort Syntax:
{SORT,ColumnName,StandardText,AscendingText,DescendingText,DefaultOrder,SortIndex}

Sort Header Syntax:
{SORTHEADER,SortIndex}

Example

<tr>     
         <th><a {SORT,EventDate,Date,"Date <img src=asc.gif>", "Date <img src=desc.gif>",ASC,7}>{SORTHEADER,7}</a></th>
</tr>            



Interaction Type
All interaction elements for ListX utilize similar formatting to keep things uniform. Check lists and Check list Items are always contained within curly braces {...} with the first parameter identifying the type of interaction. In the case of this element, SORT or SORTHEADER will be the first parameter. Other types of actions include ACTION,RADIO, and other types including CHECKLIST.

Column Name
The name of the column which will be sorted. The variable may be a single column name, or could utilize the Column Value syntax to build combined - or formatted values.

Note: If you are using table aliases within your query, the resulting sort will probably require these aliases as well. Make sure you place the complete name of the column within the confines of the sort tag, otherwise your query will cause errors upon execution.



Standard Text
The visible text displayed in place of your SORTHEADER placeholder when no sorting is currently enabled. 

Ascending Text
The visible text displayed in place of your SORTHEADER placeholder when the column is marked as rendering is Ascending order.

Descending Text
The visible text displayed in place of your SORTHEADER placeholder when the column is marked as rendering is Descending order.

Default Order
The default order of the data sorting upon first entry. Possible values are empty, ASCASC TOGGLE (Toggle only between ASC and DESC) DESC, and DESC TOGGLE (Toggle only between DESC and ASC).

Sort Index
The sort Index is used to replace the occurrence(s) of any {SORTHEADER,Index} tag where the Index would be the Sort Index contained in the sort tag.

Average ( Ratings):
 
Want to help out?
 
 

New York, NY • Baltimore, MD • Vienna, VA • St. Louis, MO • Seattle, WA • info@openwebstudio.com

Bookmark & Share Bookmark and Share