Example
The following example inserts an object instance to the grid at index position 4:
var anObject= {name:"Jim!!", age:30};
myGrid.addItemAt(4, anObject);
DataGrid.cellEdit
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
listenerObject = new Object();
listenerObject.cellEdit = function(eventObject){
// insert your code here
}
myDataGridInstance.addEventListener("cellEdit", listenerObject)
Description
Event; broadcast to all registered listeners when cell value changes.
Version 2 components use a dispatcher/listener event model. The DataGrid component
dispatches a
cellEdit
function (also called a handler) that is attached to a listener object (
create. You call the
parameter.
When the event is triggered, it automatically passes an event object (
handler. Each event object has properties that contain information about the event. You can use
these properties to write code that handles the event. The
object has four additional properties:
columnIndex
A number that indicates the index of the target row.
itemIndex
The previous value of the cell.
oldValue
The string
type
For more information, see
Example
In the following example, a handler called
myDataGrid.addEventListener()
handler in the
cellEdit
statement is sent to the Output panel.
trace
myDataGridListener = new Object();
myDataGridListener.cellEdit = function(event){
262
Chapter 6: Components Dictionary
event when the value of a cell has changed, and the event is handled by a
addEventListener()
A number that indicates the index of the target column.
.
"cellEdit"
"EventDispatcher class" on page
as the second parameter. The event object is captured by the
eventObject
method and pass it the name of the handler as a
DataGrid.cellEdit
415.
myDataGridListener
parameter. When the
listenerObject
) to the
eventObject
event's event
is defined and passed to
event is broadcast, a
cellEdit
) that you
Need help?
Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?