User Guide

DataSet component (Flash Professional only) 327
myDataSet.last();
while(myDataSet.hasPrevious()) {
var price = myDataSet.currentItem.price;
price = price * 0.5; // Everything's 50% off!
myDataSet.currentItem.price = price;
myDataSet.previous();
}
See also
DataSet.currentItem
, DataSet.skip(), DataSet.previous()
DataSet.hasSort()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSet.hasSort(sortName)
Parameters
sortName
A string that contains the name of a sort created with DataSet.addSort().
Returns
A Boolean value.
Description
Method; returns true if the sort specified by sortName exists; otherwise, returns false.
Example
The following code tests if a sort named “customerSort” exists. If the sort already exists, it is made
the current sort by means of
DataSet.useSort(). If a sort by that name doesnt exist, one is
created by means of
DataSet.addSort().
if(myDataSet.hasSort("customerSort")){
myDataSet.useSort("customerSort");
} else {
myDataSet.addSort("customerSort", ["customer"],
DataSetIterator.Descending);
}
See also
DataSet.addSort()
, DataSet.applyUpdates(), DataSet.useSort()