Sort Orders for Table Columns

You can define how table columns should be sorted when the user selects the sort tool.

Users can sort the columns by clicking on the header text link or the toolbar button. opens a dialog box allowing the user to choose up to 3 columns for sorting. Only columns defined with the Sortable=true setting can be selected. See Designing Your Own Page Views for details.

When the page displays the first time, the initial sorting is done based on the URL parameters sortColumnName and sortDirection. If you do not pass these URL parameters, the rows display in the order they are retrieved from the database. You can pass up to 3 column names with the sortColumnName parameter and 3 directions with the sortDirection parameter.

When the user opens the Sort by dialog box (by clicking in the page toolbar), the 1st, 2nd, and 3rd column name fields are populated based on the values passed to the sortColumnName and sortDirection URL parameters. If less than 3 values are passed, only the values passed show populated in the dialog box and the remaining fields are blank.

If the user creates a custom table based on the system table for the table page, the sorting options selected by the user determine the default values for the Sort by dialog box. If the user clicks on one of the other column headers to sort, the system updates the page level sortColumnName setting to the new column.

For pages that include columns with the type program or programHTMLOutput with complex logic, the sort process may take a while. You can set the Sortable setting on the column to false if needed.

To define your own sorting mechanism, see Sorting Programs for Tables.