User Guide
268 Chapter 6: Components Dictionary
Usage
listenerObject = new Object();
listenerObject.columnStretch = function(eventObject){
// insert your code here
}
myDataGridInstance.addEventListener("columnStretch", listenerObject)
Description
Event; broadcast to all registered listeners when a user resizes a column horizontally.
Version 2 components use a dispatcher/listener event model. When a DataGrid component
dispatches a
columnStretch event, the event is handled by a function (also called a handler) that
is attached to a listener object (
listenerObject) that you create. You call the
addEventListener() method and pass it the name of the handler as a parameter.
When the event is triggered, it automatically passes an event object (
eventObject) to the
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
DataGrid.columnStretch event’s
event object has two additional properties:
columnIndex A number that indicates the index of the target column. The first position is 0.
type The string "columnStretch".
For more information, see “EventDispatcher class” on page 415.
Example
In the following example, a handler called myListener is defined and passed to
grid.addEventListener() as the second parameter. The event object is captured by the
columnStretch handler in the eventObject parameter. When the columnStretch event is
broadcast, a
trace statement is sent to the Output panel.
var myListener = new Object();
myListener.columnStretch = function(event) {
trace("column " + event.columnIndex + " was resized");
};
grid.addEventListener("columnStretch", myListener);
DataGrid.dataProvider
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX Professional 2004.
Usage
myDataGrid.dataProvider
Description
Property; the data model for items viewed in a DataGrid component.