RecordSet.sortItemsBy( )


RecordSet.sortItemsBy( ) Method Flash 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( )



Flash Remoting
Flash Remoting: The Definitive Guide
ISBN: 059600401X
EAN: 2147483647
Year: 2003
Pages: 239
Authors: Tom Muck

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net