RecordSet.sortItemsBy( )

RecordSet.sortItemsBy( ) MethodFlash 6

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



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


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


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.


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

#include ""
var myRecordset_rs = new RecordSet(["First", "Last", "Email"]);
myRecordset_rs.addItem({First:"Jack", Last:"Splat", Email:""});
myRecordset_rs.addItem({First:"Tom", Last:"Muck", Email:""});

See Also

RecordSet.filter( ), RecordSet.sort( )

    Part III: Advanced Flash Remoting