DataSet.addItem
Availability
Flash Player 7.
Edition
Flash MX Professional 2004.
Usage
on(addItem) {
// insert your code here
}
listenerObject = new Object();
listenerObject.addItem = function (eventObj) {
// insert your code here
}
dataSet.addEventListener("addItem", listenerObject)
Description
Event; generated just before a new record (transfer object) is inserted into this collection.
If you set the
result
set it to
, the add operation is allowed.
true
The event object (
The DataSet object that generated the event.
target
The string
type
A reference to the item in the collection to be added.
item
A Boolean value that specifies whether the specified item should be added. By default,
result
this value is
true
Example
The following
on(addItem)
the new item if a user-defined function named
the item addition is allowed.
on(addItem) {
if(globalObj.userHasAdminPrivs()) {
// Allow the item addition.
eventObj.result = true;
} else {
// Don't allow item addition; user doesn't have admin privileges.
eventObj.result = false;
}
}
See also
DataSet.removeItem
property of the event object to
) contains the following properties:
eventObj
.
"addItem"
.
event handler (attached to a DataSet object) cancels the addition of
, the add operation is canceled; if you
false
userHasAdminPrivs()
DataSet component (Flash Professional only)
returns
; otherwise,
false
307
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?
Questions and answers