User Guide
DataSet component (Flash Professional only) 309
Parameters
index
A number greater than or equal to 0. This number indicates the position at which to
insert the item; it is the index of the new item.
item An object containing the data for the item.
Returns
A Boolean value indicating whether the item was added: true indicates that the item was added,
and
false indicates that the item already exists in the data set.
Description
Method; adds a new item to the data set at the specified index. Indices greater than the data
provider’s length are ignored.
This method triggers the
modelChanged event with the event name addItems.
Example
The following example adds an item to the data set myDataSet at the fourth position:
myDataset.addItemAt(3, {label : "this is the fourth item"});
DataSet.addSort()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSet.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.