User Guide
DataSet.removeItemAt() 397
DataSet.removeItemAt()
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
dataSetInstance.removeItemAt(index)
Parameters
index A number greater than or equal to 0. This number is the index of the item to remove.
Returns
A Boolean value indicating whether the item was removed.
Description
Method; removes the item at the specified index. The indices after the removed index collapse
by one.
This method triggers the
modelChanged event with the event name removeItems.
In addition, it triggers the DataSet.removeItem event, which contains the
result and item
properties. The
result property is used to determine if the item (referenced by the item
property of the event) can be removed. By default, the
result property is set to true. If no
event listener is specified for the
removeItem event, the item is removed by default.
An event listener can stop the item from being removed by listening for the
removeItem event
and setting the
result property of the event to false, as shown in the following example:
function removeItem(evt_obj:Object):Void {
// Don’t allow anyone to remove the item with customerId == 0.
evt_obj.result = (evt_obj.item.customerId != 0);
}