RecordSet.sortItemsBy( ) Method | Flash 6 |
sorts a recordset by a field value |
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 "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");
RecordSet.filter( ), RecordSet.sort( )