Search these areas:
Help
Support Forums
Product Info



Introduction
DataWeb: What's New
Creating an Application
The DataWeb Designer
Application Management
Data Tables
Data Tables
Views
Templates
Components
Data Analysis
Members
Security
Importing
Exporting
FTP
JavaScript
Object Model
JavaScript Objects
General Scripting Objects
Data Access Objects
cmdDelete Object
cmdInsert Object
cmdSelect Object
-execute
-getColumns
-getFilter
-getSort
-getTablename
-setColumns
-setFilter
-setSort
cmdUpdate Object
Data Access Method Arguments
Field Object
Fields Collection
Index Object
Indexes Collection
previous Object
record Object
Resultset Object
Table Object
Tables Collection
TextImporter Object
Settings Object
View Object
Web Object
File Access Objects
Http Client Objects
Security and Membership Objects
Document Object Model (DOM)
Error Descriptions
Object Model Extensions
Full-Text Search
Domain and Email Hosting
HotBlock Modules
Account Management
Glossary
New Responsive UI Module





DataWeb Help
Support Forums
Tutorial
Script Library
Knowledge Base

Home > Support

DataWeb User's Guide

cmdSelect.setSort()
Syntax

cmdSelect.setSort(sort)

Arguments Description
sort sort is the string specifying the column to sort. Preceded by a plus (+) or minus (-) will designate ascending or descending order. The plus sign is optional: placing the column name alone in the sort parameter sorts the recordset in ascending order by default. Secondary sort criteria can be specified with a comma-delimited string of column names. For example, LastName, FirstName

Returns

Return value is undefined.

Description

cmdSelect.setSort() specifies the sort order of the retrieved data. An exception is thrown if the specified column does not exist in the table.

Example

The following setSort()example sorts the LastName field alphabetically.
  var sel = new cmdSelect("AddressBook");
  sel.setFilter("*");
  sel.setSort("+LastName");
  var rs = sel.execute();
  while(rs.next())
      {
      response.write(rs.LastName + "<br>");
      }

Related Topics

cmdSelect Object, cmdSelect.getFilter(), cmdSelect.execute()
Affiliate | Partner | Terms of Use | Privacy Policy | Contact Us | Pricing | Bring DataWeb In-House    
Email Us