F > FComboBox.sortItemsBy

 

FComboBox.sortItemsBy

Availability

Flash Player 6.

Usage

myComboBox.sortItemsBy(fieldName, order)

Parameters

fieldName A string specifying the name of the field used for sorting. This will normally be "label" or "data".

order A string specifying whether to sort the items in ascending order ("ASC") or descending order ("DESC").

Returns

Nothing.

Description

Method; sorts the items in the combo box alphabetically or numerically, in the specified order, using the specified field name. If the fieldName items are a combination of text strings and integers, the integer items are listed first. The fieldName parameter is usually label or data, but you can specify any primitive data value that suits their needs.

Example

The following code sorts the items in the combo box surnameMenu in ascending order using the labels of the list items.

surnameMenu.sortItemsBy("label", "ASC");

See also

FComboBox.addItemAt, FComboBox.replaceItemAt, FComboBox.setDataProvider