RecordSet.sortItemsBy( )

RecordSet.sortItemsBy( ) MethodFlash 6

sorts a recordset by a field value
myRecordSet.sortItemsBy(fieldName, direction)

Arguments

fieldName

The field that you want to sort the RecordSet object by.

direction

The direction of the sort. "DESC" specifies a descending sort; anything else is ascending.

Description

The sortItemsBy( ) method sorts a recordset by a specified field. This creates great flexibility for how you display your recordset. For example, a display might contain column headings that are clickable; clicking the column heading could trigger the sortItemsBy( ) method.

The sortItemsBy( ) method is defined in the RsDataProviderClass class.

Example

The following code adds two rows to a recordset and then sorts the recordset by last name:

#include "RecordSet.as"
var myRecordset_rs = new RecordSet(["First", "Last", "Email"]);
myRecordset_rs.addItem({First:"Jack", Last:"Splat", Email:"jack@tom-muck.com"});
myRecordset_rs.addItem({First:"Tom", Last:"Muck", Email:"tom@tom-muck.com"});
myRecordset_rs.sortItemsBy("Last");

See Also

RecordSet.filter( ), RecordSet.sort( )



    Part III: Advanced Flash Remoting