User Guide
370 Components Dictionary
DataSet.getItemId()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSetInstance.getItemId([index])
Parameters
index A number specifying the item in the current view for which to get the ID. This
parameter is optional.
Returns
A string.
Description
Method; returns the identifier of the current item in the collection, or that of the item
specified by
index. This identifier is unique only in this collection and is assigned
automatically by
DataSet.addItem().
Example
The following code gets the unique ID for the current item in the collection and then displays
it in the Output panel.
var itemNo:String = my_ds.getItemId();
trace("Employee id(" + itemNo + ")");
The following example uses DataSet.find() to search for an item in the current collection
whose
name and id fields contain the values "Bobby" and 105, respectively. If found,
DataSet.getItemId() is used to get the unique identifier for that item, and
DataSet.locateById() is used to position the current iterator at that item.