User Guide

DataSet.addSort() 343
DataSet.addSort()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSetInstance.addSort(name, fieldList, sortOptions)
Parameters
name A string that specifies the name of the sort.
fieldList An array of strings that specify the field names to sort on.
sortOptions One or more of the following integer (constant) values, which indicate what
options are used for this sort. Separate multiple values using the bitwise OR operator (
|).
Specify one or more of the following values:
DataSetIterator.Ascending Sorts items in ascending order. This is the default sort
option, if none is specified.
DataSetIterator.Descending Sorts items in descending order based on item
properties specified.
DataSetIterator.Unique Prevents the sort if any fields have like values.
DataSetIterator.CaseInsensitive Ignores case when comparing two strings during
the sort operation. By default, sorts are case-sensitive when the property being sorted on is
a string.
A
DataSetError exception is thrown when DataSetIterator.Unique is specified as a sort
option and the data being sorted is not unique, when the specified sort name has already been
added, or when a property specified in the
fieldList array does not exist in this data set.
Returns
Nothing.
Description
Method; creates a new ascending or descending sort for the current iterator based on the
properties specified by the
fieldList parameter. Flash automatically assigns the new sort to
the current iterator after it is created, and then stores it in the sorting collection for later
retrieval.