ActionScript® 3.0 Reference for the Adobe® Flash® Platform
Home  |  Show Packages and Classes List |  Packages  |  Classes  |  What's New  |  Index  |  Appendixes
spark.components 

DataGrid  - AS3 Flex

Packagespark.components
Classpublic class DataGrid
InheritanceDataGrid Inheritance SkinnableContainerBase Inheritance SkinnableComponent Inheritance UIComponent Inheritance FlexSprite Inheritance Sprite Inheritance DisplayObjectContainer Inheritance InteractiveObject Inheritance DisplayObject Inheritance EventDispatcher Inheritance Object
Implements IFocusManagerComponent, IIMESupport
Subclasses SearchResultsGrid

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5


Adobe recommends that you not use this component in an application that uses the mobileDevice profile.

The DataGrid displays a row of column headings above a scrollable grid. The grid is arranged as a collection of individual cells arranged in rows and columns. The DataGrid control is designed to support smooth scrolling through large numbers of rows and columns.

The Spark DataGrid control is implemented as a skinnable wrapper around the Spark Grid control. The Grid control defines the columns of the data grid, and much of the functionality of the DataGrid control itself.

The DataGrid skin is responsible for laying out the grid, column header, and scroller. The skin also configures the graphic elements used to render visual elements used as indicators, separators, and backgrounds. The DataGrid skin also defines a default item renderer, used to display the contents of each cell. Please see the documentation for the renderer class for the list of supported styles.

Transitions in DataGrid item renderers aren't supported. The GridItemRenderer class has disabled its transitions property so setting it will have no effect.

MXML SyntaxexpandedHide MXML Syntax

The <s:DataGrid> tag inherits all of the tag attributes of its superclass and adds the following tag attributes:

  <s:DataGrid 
    Properties
    columns="null"
    dataProvider="null"  
    dataTipField="null"  
    dataTipFunction="null"
    editable="false"
    editorColumnIndex="-1"
    editorRowIndex="-1"
    imeMode="null"
    itemEditor="null"
    itemRenderer="DefaultGridItemRenderer" 
    preserveSelection="true"
    requestedColumnCount="-1"
    requestedMaxRowCount="-1"
    requestedMinColumnCount="-1"
    requestedMinRowCount="-1"
    requestedRowCount="-1"
    requireSelection="false"
    resizeableColumns="true"
    rowHeight="Calculated default"
    selectedCell="null"
    selectedCells="empty Vector.<CellPosition&gt"
    selectedIndex="null"
    selectedIndices="empty Vector.<CellPosition&gt"
    selectedItem="null"
    selectedItems="empty Vector.<Object&gt"
    selectionMode="singleRow"
    showDataTips="false"
    sortableColumns="true"
    typicalItem="null"
    variableRowHeight="false" 
 
    Styles
    alignmentBaseline="useDominantBaseline"
    baselineShift="0.0"
    cffHinting="horizontalStem"
    color="0"
    defaultGridItemEditor="null"
    digitCase="default"
    digitWidth="default"
    direction="ltr"
    dominantBaseline="auto"
    fontFamily="Arial"
    fontLookup="device"
    fontSize="12"
    fontStyle="normal"
    fontWeight="normal"
    justificationRule="auto"
    justificationStyle="auto"
    kerning="auto"
    ligatureLevel="common"
    lineHeight="120%"
    lineThrough="false"
    locale="en"
    renderingMode="cff"
    stretchCursor="cursorStretch symbol from Assets.swf"
    textAlign="start"
    textAlignLast="start"
    textAlpha="1"
    textDecoration="none"
    textJustify="interWord"
    trackingLeft="0"
    trackingRight="0"
    typographicCase="default"
    verticalScrollPolicy="auto"
 
    Styles for the Spark Theme
    alternatingRowColors="undefined"
    borderAlpha="1.0"
    borderColor="0x696969"
    borderVisible="true"
    caretColor="0x0167FF"
    contentBackgroundAlpha="1.0"
    contentBackgroundColor="0xFFFFFF"
    rollOverColor="0xCEDBEF"
    selectionColor="0xA8C6EE"
    symbolColor="0x000000"
 
    Styles for the Mobile Theme
    leading="0"
    letterSpacing="0"
    selectionColor="0xE0E0E0"
    symbolColor="0x000000"
 
    Events
    caretChange="No default"
    gridClick="No default"
    gridDoubleClick="No default"
    gridItemEditorSessionCancel="No default"
    gridItemEditorSessionSave="No default"
    gridItemEditorSessionStart="No default"
    gridItemEditorSessionStarting="No default"
    gridMouseDown="No default"
    gridMouseDrag="No default"
    gridMouseUp="No default"
    gridMouseRollOut="No default"
    gridMouseRollOver="No default"
    selectionChange="No default"
    selectionChanging="No default"
    sortChange="No default"
    sortChanging="No default" 
  />
  

Default MXML PropertydataProvider

View the examples

More examples

Learn more

Related API Elements



Public Properties
 PropertyDefined By
 InheritedaccessibilityDescription : String
A convenience accessor for the description property in this UIComponent's accessibilityProperties object.
UIComponent
 InheritedaccessibilityEnabled : Boolean
A convenience accessor for the silent property in this UIComponent's accessibilityProperties object.
UIComponent
 InheritedaccessibilityImplementation : AccessibilityImplementation
The current accessibility implementation (AccessibilityImplementation) for this InteractiveObject instance.
InteractiveObject
 InheritedaccessibilityName : String
A convenience accessor for the name property in this UIComponent's accessibilityProperties object.
UIComponent
 InheritedaccessibilityProperties : AccessibilityProperties
The current accessibility options for this display object.
DisplayObject
 InheritedaccessibilityShortcut : String
A convenience accessor for the shortcut property in this UIComponent's accessibilityProperties object.
UIComponent
 InheritedactiveEffects : Array
[read-only] The list of effects that are currently playing on the component, as an Array of EffectInstance instances.
UIComponent
 Inheritedalpha : Number
Indicates the alpha transparency value of the object specified.
DisplayObject
 InheritedautomationDelegate : Object
The delegate object that handles the automation-related functionality.
UIComponent
 InheritedautomationEnabled : Boolean
[read-only] True if this component is enabled for automation, false otherwise.
UIComponent
 InheritedautomationName : String
Name that can be used as an identifier for this object.
UIComponent
 InheritedautomationOwner : DisplayObjectContainer
[read-only] The owner of this component for automation purposes.
UIComponent
 InheritedautomationParent : DisplayObjectContainer
[read-only] The parent of this component for automation purposes.
UIComponent
 InheritedautomationTabularData : Object
[read-only] An implementation of the IAutomationTabularData interface, which can be used to retrieve the data.
UIComponent
 InheritedautomationValue : Array
[read-only] This value generally corresponds to the rendered appearance of the object and should be usable for correlating the identifier with the object as it appears visually within the application.
UIComponent
 InheritedautomationVisible : Boolean
[read-only] True if this component is visible for automation, false otherwise.
UIComponent
 Inheritedbaseline : Object
For components, this layout constraint property is a facade on top of the similarly-named style.
UIComponent
 InheritedbaselinePosition : Number
[override] [read-only] The y-coordinate of the baseline of the first line of text of the component.
SkinnableComponent
 InheritedblendMode : String
A value from the BlendMode class that specifies which blend mode to use.
DisplayObject
 InheritedblendShader : Shader
[write-only] Sets a shader that is used for blending the foreground and background.
DisplayObject
 Inheritedbottom : Object
For components, this layout constraint property is a facade on top of the similarly-named style.
UIComponent
 InheritedbuttonMode : Boolean
Specifies the button mode of this sprite.
Sprite
 InheritedcacheAsBitmap : Boolean
If set to true, Flash runtimes cache an internal bitmap representation of the display object.
DisplayObject
 Inherited    cacheAsBitmapMatrix : Matrix
If non-null, this Matrix object defines how a display object is rendered when cacheAsBitmap is set to true.
DisplayObject
 InheritedcacheHeuristic : Boolean
[write-only] Used by Flex to suggest bitmap caching for the object.
UIComponent
 InheritedcachePolicy : String
Specifies the bitmap caching policy for this object.
UIComponent
 InheritedclassName : String
[read-only] The name of this instance's class, such as "Button".
UIComponent
  columns : IList
The list of GridColumn objectss displayed by this grid.
DataGrid
  columnsLength : int
[read-only] Returns the value of columns.length if the columns IList was specified, otherwise 0.
DataGrid
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
 InheritedcontentMouseX : Number
[read-only] Returns the x position of the mouse, in the content coordinate system.
UIComponent
 InheritedcontentMouseY : Number
[read-only] Returns the y position of the mouse, in the content coordinate system.
UIComponent
 InheritedcontextMenu : NativeMenu
Specifies the context menu associated with this object.
InteractiveObject
 InheritedcurrentState : String
The current view state of the component.
UIComponent
 InheritedcursorManager : ICursorManager
[read-only] Gets the CursorManager that controls the cursor for this component and its peers.
UIComponent
  dataProvider : IList
A list of data items that correspond to the rows in the grid.
DataGrid
  dataProviderLength : int
[read-only] Returns the value of dataProvider.length if the dataProvider IList was specified, otherwise 0.
DataGrid
  dataTipField : String
The name of the field in the data provider to display as the datatip.
DataGrid
  dataTipFunction : Function
Specifies a callback function to run on each item of the data provider to determine its data tip.
DataGrid
 InheriteddefaultButton : IFlexDisplayObject
The Button control designated as the default button for the container.
SkinnableContainerBase
 Inheriteddepth : Number
Determines the order in which items inside of containers are rendered.
UIComponent
 Inheriteddescriptor : UIComponentDescriptor
Reference to the UIComponentDescriptor, if any, that was used by the createComponentFromDescriptor() method to create this UIComponent instance.
UIComponent
 InheriteddesignLayer : DesignLayer
Specifies the optional DesignLayer instance associated with this visual element.
UIComponent
 Inheriteddocument : Object
A reference to the document object associated with this UIComponent.
UIComponent
 InheriteddoubleClickEnabled : Boolean
[override] Specifies whether the UIComponent object receives doubleClick events.
UIComponent
 InheriteddropTarget : DisplayObject
[read-only] Specifies the display object over which the sprite is being dragged, or on which the sprite was dropped.
Sprite
  editable : Boolean
The default value for the GridColumn editable property, which indicates if a corresponding cell's data provider item can be edited.
DataGrid
  editorColumnIndex : int
[read-only] The zero-based column index of the cell that is being edited.
DataGrid
  editorRowIndex : int
[read-only] The zero-based row index of the cell that is being edited.
DataGrid
 Inheritedenabled : Boolean
Whether the component can accept user interaction.
UIComponent
  enableIME : Boolean
[read-only] A flag that indicates whether the IME should be enabled when the component receives focus.
DataGrid
 InheritederrorString : String
The text that displayed by a component's error tip when a component is monitored by a Validator and validation fails.
UIComponent
 InheritedexplicitHeight : Number
Number that specifies the explicit height of the component, in pixels, in the component's coordinates.
UIComponent
 InheritedexplicitMaxHeight : Number
The maximum recommended height of the component to be considered by the parent during layout.
UIComponent
 InheritedexplicitMaxWidth : Number
The maximum recommended width of the component to be considered by the parent during layout.
UIComponent
 InheritedexplicitMinHeight : Number
The minimum recommended height of the component to be considered by the parent during layout.
UIComponent
 InheritedexplicitMinWidth : Number
The minimum recommended width of the component to be considered by the parent during layout.
UIComponent
 InheritedexplicitWidth : Number
Number that specifies the explicit width of the component, in pixels, in the component's coordinates.
UIComponent
 Inheritedfilters : Array
An indexed array that contains each filter object currently associated with the display object.
DisplayObject
 InheritedflexContextMenu : IFlexContextMenu
The context menu for this UIComponent.
UIComponent
 InheritedfocusEnabled : Boolean
Indicates whether the component can receive focus when tabbed to.
UIComponent
 InheritedfocusManager : IFocusManager
Gets the FocusManager that controls focus for this component and its peers.
UIComponent
 InheritedfocusPane : Sprite
The focus pane associated with this object.
UIComponent
 InheritedfocusRect : Object
Specifies whether this object displays a focus rectangle.
InteractiveObject
 Inheritedgraphics : Graphics
[read-only] Specifies the Graphics object that belongs to this sprite where vector drawing commands can occur.
Sprite
 InheritedhasFocusableChildren : Boolean
A flag that indicates whether child objects can receive focus.
UIComponent
 InheritedhasLayoutMatrix3D : Boolean
[read-only] Contains true if the element has 3D Matrix.
UIComponent
 Inheritedheight : Number
[override] Number that specifies the height of the component, in pixels, in the parent's coordinates.
UIComponent
 InheritedhitArea : Sprite
Designates another sprite to serve as the hit area for a sprite.
Sprite
 InheritedhorizontalCenter : Object
For components, this layout constraint property is a facade on top of the similarly-named style.
UIComponent
 Inheritedid : String
ID of the component.
UIComponent
  imeMode : String
The default value for the GridColumn imeMode property, which specifies the IME (Input Method Editor) mode.
DataGrid
 InheritedincludeInLayout : Boolean
Specifies whether this component is included in the layout of the parent container.
UIComponent
 InheritedinheritingStyles : Object
The beginning of this component's chain of inheriting styles.
UIComponent
 Inheritedinitialized : Boolean
A flag that determines if an object has been through all three phases of layout: commitment, measurement, and layout (provided that any were required).
UIComponent
 InheritedinstanceIndex : int
[read-only] The index of a repeated component.
UIComponent
 InheritedinstanceIndices : Array
An Array containing the indices required to reference this UIComponent object from its parent document.
UIComponent
 Inheritedis3D : Boolean
[read-only] Contains true when the element is in 3D.
UIComponent
 InheritedisDocument : Boolean
[read-only] Contains true if this UIComponent instance is a document object.
UIComponent
 InheritedisPopUp : Boolean
Set to true by the PopUpManager to indicate that component has been popped up.
UIComponent
  itemEditor : IFactory
The default value for the GridColumn itemEditor property, which specifies the IGridItemEditor class used to create item editor instances.
DataGrid
  itemEditorInstance : IGridItemEditor
[read-only] A reference to the currently active instance of the item editor, if it exists.
DataGrid
  itemRenderer : IFactory
The item renderer that's used for columns that do not specify one.
DataGrid
 InheritedlayoutMatrix3D : Matrix3D
[write-only] The transform matrix that is used to calculate a component's layout relative to its siblings.
UIComponent
 Inheritedleft : Object
For components, this layout constraint property is a facade on top of the similarly-named style.
UIComponent
 InheritedloaderInfo : LoaderInfo
[read-only] Returns a LoaderInfo object containing information about loading the file to which this display object belongs.
DisplayObject
 InheritedmaintainProjectionCenter : Boolean
When true, the component keeps its projection matrix centered on the middle of its bounding box.
UIComponent
 Inheritedmask : DisplayObject
The calling display object is masked by the specified mask object.
DisplayObject
 InheritedmaxHeight : Number
The maximum recommended height of the component to be considered by the parent during layout.
UIComponent
 InheritedmaxWidth : Number
The maximum recommended width of the component to be considered by the parent during layout.
UIComponent
 InheritedmeasuredHeight : Number
The default height of the component, in pixels.
UIComponent
 InheritedmeasuredMinHeight : Number
The default minimum height of the component, in pixels.
UIComponent
 InheritedmeasuredMinWidth : Number
The default minimum width of the component, in pixels.
UIComponent
 InheritedmeasuredWidth : Number
The default width of the component, in pixels.
UIComponent
 InheritedmetaData : Object
Obtains the meta data object of the DisplayObject instance if meta data was stored alongside the the instance of this DisplayObject in the SWF file through a PlaceObject4 tag.
DisplayObject
 InheritedminHeight : Number
The minimum recommended height of the component to be considered by the parent during layout.
UIComponent
 InheritedminWidth : Number
The minimum recommended width of the component to be considered by the parent during layout.
UIComponent
 InheritedmoduleFactory : IFlexModuleFactory
A module factory is used as context for using embedded fonts and for finding the style manager that controls the styles for this component.
UIComponent
 InheritedmouseChildren : Boolean
Determines whether or not the children of the object are mouse, or user input device, enabled.
DisplayObjectContainer
 InheritedmouseEnabled : Boolean
Specifies whether this object receives mouse, or other user input, messages.
InteractiveObject
 InheritedmouseFocusEnabled : Boolean
Whether you can receive focus when clicked on.
UIComponent
 InheritedmouseX : Number
[read-only] Indicates the x coordinate of the mouse or user input device position, in pixels.
DisplayObject
 InheritedmouseY : Number
[read-only] Indicates the y coordinate of the mouse or user input device position, in pixels.
DisplayObject
 Inheritedname : String
Indicates the instance name of the DisplayObject.
DisplayObject
 InheritedneedsSoftKeyboard : Boolean
Specifies whether a virtual keyboard (an on-screen, software keyboard) should display when this InteractiveObject instance receives focus.
InteractiveObject
 InheritednestLevel : int
Depth of this object in the containment hierarchy.
UIComponent
 InheritednonInheritingStyles : Object
The beginning of this component's chain of non-inheriting styles.
UIComponent
 InheritednumAutomationChildren : int
[read-only] The number of automation children this container has.
UIComponent
 InheritedopaqueBackground : Object
Specifies whether the display object is opaque with a certain background color.
DisplayObject
 Inheritedowner : DisplayObjectContainer
The owner of this IVisualElement object.
UIComponent
 Inheritedparent : DisplayObjectContainer
[override] [read-only] The parent container or component for this component.
UIComponent
 InheritedparentApplication : Object
[read-only] A reference to the Application object that contains this UIComponent instance.
UIComponent
 InheritedparentDocument : Object
[read-only] A reference to the parent document object for this UIComponent.
UIComponent
 InheritedpercentHeight : Number
Specifies the height of a component as a percentage of its parent's size.
UIComponent
 InheritedpercentWidth : Number
Specifies the width of a component as a percentage of its parent's size.
UIComponent
 InheritedpostLayoutTransformOffsets : mx.geom:TransformOffsets
Defines a set of adjustments that can be applied to the object's transform in a way that is invisible to its parent's layout.
UIComponent
  preserveSelection : Boolean
If true, the selection is preserved when the data provider refreshes its collection.
DataGrid
 InheritedprocessedDescriptors : Boolean
Set to true after immediate or deferred child creation, depending on which one happens.
UIComponent
 Inheritedrepeater : IRepeater
[read-only] A reference to the Repeater object in the parent document that produced this UIComponent.
UIComponent
 InheritedrepeaterIndex : int
[read-only] The index of the item in the data provider of the Repeater that produced this UIComponent.
UIComponent
 InheritedrepeaterIndices : Array
An Array containing the indices of the items in the data provider of the Repeaters in the parent document that produced this UIComponent.
UIComponent
 Inheritedrepeaters : Array
An Array containing references to the Repeater objects in the parent document that produced this UIComponent.
UIComponent
  requestedColumnCount : int
The measured width of this grid is large enough to display the first requestedColumnCount columns.
DataGrid
  requestedMaxRowCount : int
The measured height of the grid is large enough to display no more than requestedMaxRowCount rows.
DataGrid
  requestedMinColumnCount : int
The measured width of this grid is large enough to display at least requestedMinColumnCount columns.
DataGrid
  requestedMinRowCount : int
The measured height of this grid is large enough to display at least requestedMinRowCount rows.
DataGrid
  requestedRowCount : int
The measured height of this grid is large enough to display the first requestedRowCount rows.
DataGrid
  requireSelection : Boolean
If true and the selectionMode property is not GridSelectionMode.NONE, an item must always be selected in the grid.
DataGrid
  resizableColumns : Boolean
Indicates whether the user can change the size of the columns.
DataGrid
 Inheritedright : Object
For components, this layout constraint property is a facade on top of the similarly-named style.
UIComponent
 Inheritedroot : DisplayObject
[read-only] For a display object in a loaded SWF file, the root property is the top-most display object in the portion of the display list's tree structure represented by that SWF file.
DisplayObject
 Inheritedrotation : Number
[override] Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation.
UIComponent
 InheritedrotationX : Number
[override] Indicates the x-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
UIComponent
 InheritedrotationY : Number
[override] Indicates the y-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
UIComponent
 InheritedrotationZ : Number
[override] Indicates the z-axis rotation of the DisplayObject instance, in degrees, from its original orientation relative to the 3D parent container.
UIComponent
  rowHeight : Number
If variableRowHeight is false, then this property specifies the actual height of each row, in pixels.
DataGrid
 Inheritedscale9Grid : Rectangle
The current scaling grid that is in effect.
DisplayObject
 InheritedscaleX : Number
[override] Number that specifies the horizontal scaling factor.
UIComponent
 InheritedscaleY : Number
[override] Number that specifies the vertical scaling factor.
UIComponent
 InheritedscaleZ : Number
[override] Number that specifies the scaling factor along the z axis.
UIComponent
 Inheritedscreen : Rectangle
[read-only] Returns an object that contains the size and position of the base drawing surface for this object.
UIComponent
 InheritedscrollRect : Rectangle
The scroll rectangle bounds of the display object.
DisplayObject
  selectedCell : CellPosition
If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, returns the first selected cell starting at row 0 column 0 and progressing through each column in a row before moving to the next row.
DataGrid
  selectedCells : Vector.<CellPosition>
If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, returns a Vector of CellPosition objects representing the positions of the selected cells in the grid.
DataGrid
  selectedIndex : int
If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns the rowIndex of the first selected row.
DataGrid
  selectedIndices : Vector.<int>
If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns a Vector of the selected rows indices.
DataGrid
  selectedItem : Object
If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns the item in the the data provider that is currently selected or undefined if no rows are selected.
DataGrid
  selectedItems : Vector.<Object>
If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns a Vector of the dataProvider items that are currently selected.
DataGrid
  selectionLength : int
[read-only] If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns the number of selected rows.
DataGrid
  selectionMode : String
The selection mode of the control.
DataGrid
  showDataTips : Boolean
If true then a dataTip is displayed for all visible cells.
DataGrid
 InheritedshowInAutomationHierarchy : Boolean
A flag that determines if an automation object shows in the automation hierarchy.
UIComponent
 Inheritedskin : UIComponent
[read-only] The instance of the skin class for this component instance.
SkinnableComponent
 InheritedsoftKeyboardInputAreaOfInterest : Rectangle
Defines the area that should remain on-screen when a soft keyboard is displayed (not available on iOS).
InteractiveObject
  sortableColumns : Boolean
Specifies whether the user can interactively sort columns.
DataGrid
 InheritedsoundTransform : flash.media:SoundTransform
Controls sound within this sprite.
Sprite
 Inheritedstage : Stage
[read-only] The Stage of the display object.
DisplayObject
 Inheritedstates : Array
The view states that are defined for this component.
UIComponent
 InheritedstyleDeclaration : CSSStyleDeclaration
Storage for the inline inheriting styles on this object.
UIComponent
 InheritedstyleManager : IStyleManager2
[read-only] Returns the StyleManager instance used by this component.
UIComponent
 InheritedstyleName : Object
The class style used by this component.
UIComponent
 InheritedstyleParent : IAdvancedStyleClient
A component's parent is used to evaluate descendant selectors.
UIComponent
 InheritedsuggestedFocusSkinExclusions : Array
[read-only] Lists the skin parts that are excluded from bitmaps captured and used to show focus.
SkinnableComponent
 InheritedsystemManager : ISystemManager
Returns the SystemManager object used by this component.
UIComponent
 InheritedtabChildren : Boolean
Determines whether the children of the object are tab enabled.
DisplayObjectContainer
 InheritedtabEnabled : Boolean
Specifies whether this object is in the tab order.
InteractiveObject
 InheritedtabFocusEnabled : Boolean
A flag that indicates whether this object can receive focus via the TAB key This is similar to the tabEnabled property used by the Flash Player. This is usually true for components that handle keyboard input, but some components in controlbars have them set to false because they should not steal focus from another component like an editor.
UIComponent
 InheritedtabIndex : int
Specifies the tab ordering of objects in a SWF file.
InteractiveObject
 InheritedtextSnapshot : flash.text:TextSnapshot
[read-only] Returns a TextSnapshot object for this DisplayObjectContainer instance.
DisplayObjectContainer
 InheritedtoolTip : String
Text to display in the ToolTip.
UIComponent
 Inheritedtop : Object
For components, this layout constraint property is a facade on top of the similarly-named style.
UIComponent
 Inheritedtransform : flash.geom:Transform
[override] An object with properties pertaining to a display object's matrix, color transform, and pixel bounds.
UIComponent
 InheritedtransformX : Number
Sets the x coordinate for the transform center of the component.
UIComponent
 InheritedtransformY : Number
Sets the y coordinate for the transform center of the component.
UIComponent
 InheritedtransformZ : Number
Sets the z coordinate for the transform center of the component.
UIComponent
 Inheritedtransitions : Array
An Array of Transition objects, where each Transition object defines a set of effects to play when a view state change occurs.
UIComponent
 InheritedtweeningProperties : Array
Array of properties that are currently being tweened on this object.
UIComponent
  typicalItem : Object
The grid's layout ensures that columns whose width is not specified is wide enough to display an item renderer for this default data provider item.
DataGrid
 Inheriteduid : String
A unique identifier for the object.
UIComponent
 InheritedupdateCompletePendingFlag : Boolean
A flag that determines if an object has been through all three phases of layout validation (provided that any were required).
UIComponent
 InheriteduseHandCursor : Boolean
A Boolean value that indicates whether the pointing hand (hand cursor) appears when the pointer rolls over a sprite in which the buttonMode property is set to true.
Sprite
 InheritedvalidationSubField : String
Used by a validator to associate a subfield with this component.
UIComponent
  variableRowHeight : Boolean
If true, each row's height is the maximum of preferred heights of the cells displayed so far.
DataGrid
 InheritedverticalCenter : Object
For components, this layout constraint property is a facade on top of the similarly-named style.
UIComponent
 Inheritedvisible : Boolean
[override] Whether or not the display object is visible.
UIComponent
 Inheritedwidth : Number
[override] Number that specifies the width of the component, in pixels, in the parent's coordinates.
UIComponent
 Inheritedx : Number
[override] Number that specifies the component's horizontal position, in pixels, within its parent container.
UIComponent
 Inheritedy : Number
[override] Number that specifies the component's vertical position, in pixels, within its parent container.
UIComponent
 Inheritedz : Number
[override] Indicates the z coordinate position along the z-axis of the DisplayObject instance relative to the 3D parent container.
UIComponent
Protected Properties
 PropertyDefined By
 InheritedcurrentCSSState : String
[override] [read-only] The state to be used when matching CSS pseudo-selectors.
SkinnableComponent
 InheritedhasComplexLayoutMatrix : Boolean
[read-only] Returns true if the UIComponent has any non-translation (x,y) transform properties.
UIComponent
 InheritedresourceManager : IResourceManager
[read-only] A reference to the object which manages all of the application's localized resources.
UIComponent
 InheritedunscaledHeight : Number
[read-only] A convenience method for determining the unscaled height of the component.
UIComponent
 InheritedunscaledWidth : Number
[read-only] A convenience method for determining the unscaled width of the component All of a component's drawing and child layout should be done within a bounding rectangle of this width, which is also passed as an argument to updateDisplayList().
UIComponent
Public Methods
 MethodDefined By
  
Constructor.
DataGrid
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
  
addSelectedCell(rowIndex:int, columnIndex:int):Boolean
If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, adds the cell to the selection and sets the caret position to the cell.
DataGrid
  
If selectionMode is GridSelectionMode.MULTIPLE_ROWS, adds this row to the selection and sets the caret position to this row.
DataGrid
 Inherited
Adds a non-visual style client to this component instance.
UIComponent
 Inherited
Indicates whether the security restrictions would cause any display objects to be omitted from the list returned by calling the DisplayObjectContainer.getObjectsUnderPoint() method with the specified point point.
DisplayObjectContainer
 Inherited
callLater(method:Function, args:Array = null):void
Queues a function to be called later.
UIComponent
  
Removes all of the selected rows and cells, if selectionMode is not GridSelectionMode.NONE.
DataGrid
 Inherited
Deletes a style property from this component instance.
UIComponent
 Inherited
Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance itself.
DisplayObjectContainer
 Inherited
Converts a Point object from content coordinates to global coordinates.
UIComponent
 Inherited
Converts a Point object from content to local coordinates.
UIComponent
 Inherited
Returns a set of properties that identify the child within this container.
UIComponent
 Inherited
Returns a set of properties that identify the child within this container.
UIComponent
 Inherited
Creates an id reference to this IUIComponent object on its parent document object.
UIComponent
 Inherited
Deletes the id reference to this IUIComponent object on its parent document object.
UIComponent
 Inherited
Returns a UITextFormat object corresponding to the text styles for this UIComponent.
UIComponent
 Inherited
[override] Dispatches an event into the event flow.
UIComponent
 Inherited
Shows or hides the focus indicator around this component.
UIComponent
 Inherited
drawRoundRect(x:Number, y:Number, w:Number, h:Number, r:Object = null, c:Object = null, alpha:Object = null, rot:Object = null, gradient:String = null, ratios:Array = null, hole:Object = null):void
Programmatically draws a rectangle into this skin's Graphics object.
UIComponent
 Inherited
Called by the effect instance when it stops playing on the component.
UIComponent
 Inherited
Called by the effect instance when it starts playing on the component.
UIComponent
 Inherited
Ends all currently playing effects on the component.
UIComponent
  
Closes the currently active editor and optionally saves the editor's value by calling the item editor's save() method.
DataGrid
  
ensureCellIsVisible(rowIndex:int, columnIndex:int = -1):void
If necessary, set the verticalScrollPosition and horizontalScrollPosition properties so that the specified cell is completely visible.
DataGrid
 Inherited
executeBindings(recurse:Boolean = false):void
Executes all the bindings for which the UIComponent object is the destination.
UIComponent
 Inherited
Called after printing is complete.
UIComponent
 Inherited
Provides the automation object at the specified index.
UIComponent
 Inherited
Provides the automation object list .
UIComponent
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.
DisplayObject
 Inherited
getBoundsXAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number
Returns the x coordinate of the element's bounds at the specified element size.
UIComponent
 Inherited
getBoundsYAtSize(width:Number, height:Number, postLayoutTransform:Boolean = true):Number
Returns the y coordinate of the element's bounds at the specified element size.
UIComponent
 Inherited
Returns the child display object that exists with the specified name.
DisplayObjectContainer
 Inherited
Finds the type selectors for this UIComponent instance.
UIComponent
 Inherited
getConstraintValue(constraintName:String):*
Returns a layout constraint value, which is the same as getting the constraint style for this component.
UIComponent
 Inherited
A convenience method for determining whether to use the explicit or measured height
UIComponent
 Inherited
A convenience method for determining whether to use the explicit or measured width
UIComponent
 Inherited
Gets the object that currently has focus.
UIComponent
 Inherited
getLayoutBoundsHeight(postLayoutTransform:Boolean = true):Number
Returns the element's layout height.
UIComponent
 Inherited
getLayoutBoundsWidth(postLayoutTransform:Boolean = true):Number
Returns the element's layout width.
UIComponent
 Inherited
getLayoutBoundsX(postLayoutTransform:Boolean = true):Number
Returns the x coordinate that the element uses to draw on screen.
UIComponent
 Inherited
getLayoutBoundsY(postLayoutTransform:Boolean = true):Number
Returns the y coordinate that the element uses to draw on screen.
UIComponent
 Inherited
Returns the transform matrix that is used to calculate the component's layout relative to its siblings.
UIComponent
 Inherited
Returns the layout transform Matrix3D for this element.
UIComponent
 Inherited
getMaxBoundsHeight(postLayoutTransform:Boolean = true):Number
Returns the element's maximum height.
UIComponent
 Inherited
getMaxBoundsWidth(postLayoutTransform:Boolean = true):Number
Returns the element's maximum width.
UIComponent
 Inherited
getMinBoundsHeight(postLayoutTransform:Boolean = true):Number
Returns the element's minimum height.
UIComponent
 Inherited
getMinBoundsWidth(postLayoutTransform:Boolean = true):Number
Returns the element's minimum width.
UIComponent
 Inherited
Returns an array of objects that lie under the specified point and are children (or grandchildren, and so on) of this DisplayObjectContainer instance.
DisplayObjectContainer
 Inherited
getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number
Returns the element's preferred height.
UIComponent
 Inherited
getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number
Returns the element's preferred width.
UIComponent
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
Returns a rectangle that defines the boundary of the display object, based on the coordinate system defined by the targetCoordinateSpace parameter, excluding any strokes on shapes.
DisplayObject
 Inherited
getRepeaterItem(whichRepeater:int = -1):Object
Returns the item in the dataProvider that was used by the specified Repeater to produce this Repeater, or null if this Repeater isn't repeated.
UIComponent
 Inherited
getStyle(styleProp:String):*
Gets a style property that has been set anywhere in this component's style lookup chain.
UIComponent
 Inherited
Converts a Point object from global to content coordinates.
UIComponent
 Inherited
Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.
DisplayObject
 Inherited
Converts a two-dimensional point from the Stage (global) coordinates to a three-dimensional display object's (local) coordinates.
DisplayObject
 Inherited
Returns true if currentCSSState is not null.
UIComponent
 Inherited
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Determines whether the specified state has been defined on this UIComponent.
UIComponent
 Inherited
Evaluates the bounding box of the display object to see if it overlaps or intersects with the bounding box of the obj display object.
DisplayObject
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
Evaluates the display object to see if it overlaps or intersects with the point specified by the x and y parameters.
DisplayObject
 Inherited
Returns a box Matrix which can be passed to the drawRoundRect() method as the rot parameter when drawing a horizontal gradient.
UIComponent
 Inherited
Initializes the internal structure of this component.
UIComponent
 Inherited
Initializes various properties which keep track of repeated instances of this component.
UIComponent
  
invalidateCell(rowIndex:int, columnIndex:int):void
If the specified cell is visible, it is redisplayed.
DataGrid
 Inherited
Marks a component so that its updateDisplayList() method gets called during a later screen update.
UIComponent
 Inherited
Called by a component's items to indicate that their depth property has changed.
UIComponent
 Inherited
An element must call this method when its layoutDirection changes or when its parent's layoutDirection changes.
UIComponent
 Inherited
Marks a component so that its commitProperties() method gets called during a later screen update.
UIComponent
 Inherited
Marks a component so that its measure() method gets called during a later screen update.
UIComponent
 Inherited
Marks the component so that the new state of the skin is set during a later screen update.
SkinnableComponent
  
DataGrid
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Converts a three-dimensional point of the three-dimensional display object's (local) coordinates to a two-dimensional point in the Stage (global) coordinates.
DisplayObject
 Inherited
Converts a Point object from local to content coordinates.
UIComponent
 Inherited
Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.
DisplayObject
 Inherited
Returns true if cssState matches currentCSSState.
UIComponent
 Inherited
Determines whether this instance is the same as, or is a subclass of, the given type.
UIComponent
 Inherited
Measures the specified HTML text, which can contain HTML tags such as <font> and <b>, assuming that it is displayed in a single-line UITextField using a UITextFormat determined by the styles of this UIComponent.
UIComponent
 Inherited
Measures the specified text, assuming that it is displayed in a single-line UITextField (or UIFTETextField) using a UITextFormat determined by the styles of this UIComponent.
UIComponent
 Inherited
Moves the component to a specified position within its parent.
UIComponent
 Inherited
Propagates style changes to the children.
UIComponent
 Inherited
Returns true if the chain of owner properties points from child to this UIComponent.
UIComponent
 Inherited
Called by Flex when a UIComponent object is added to or removed from a parent.
UIComponent
 Inherited
Prepares an IFlexDisplayObject for printing.
UIComponent
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Builds or rebuilds the CSS style cache for this component and, if the recursive parameter is true, for all descendants of this component as well.
UIComponent
 Inherited
For each effect event, registers the EffectManager as one of the event listeners.
UIComponent
 Inherited
removeChildren(beginIndex:int = 0, endIndex:int = 0x7fffffff):void
Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance.
DisplayObjectContainer
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
  
removeSelectedCell(rowIndex:int, columnIndex:int):Boolean
If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, removes the cell from the selection and sets the caret position to the cell.
DataGrid
  
If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, removes this row from the selection and sets the caret position to this row.
DataGrid
 Inherited
Removes a non-visual style client from this component instance.
UIComponent
 Inherited
Replays the specified event.
UIComponent
 Inherited
Raises a virtual keyboard.
InteractiveObject
 Inherited
Resolves a child by using the id provided.
UIComponent
 Inherited
[static] Resumes the background processing of methods queued by callLater(), after a call to suspendBackgroundProcessing().
UIComponent
  
If selectionMode is GridSelectionMode.MULTIPLE_ROWS, selects all rows and removes the caret or if selectionMode is GridSelectionMode.MULTIPLE_CELLS selects all cells and removes the caret.
DataGrid
  
selectCellRegion(rowIndex:int, columnIndex:int, rowCount:uint, columnCount:uint):Boolean
If selectionMode is GridSelectionMode.MULTIPLE_CELLS, sets the selection to all the cells in the cell region and the caret position to the last cell in the cell region.
DataGrid
  
selectIndices(rowIndex:int, rowCount:int):Boolean
If selectionMode is GridSelectionMode.MULTIPLE_ROWS, sets the selection to the specfied rows and the caret position to endRowIndex.
DataGrid
  
selectionContainsCell(rowIndex:int, columnIndex:int):Boolean
If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, returns true if the cell is in the current selection.
DataGrid
  
selectionContainsCellRegion(rowIndex:int, columnIndex:int, rowCount:int, columnCount:int):Boolean
If selectionMode is GridSelectionMode.MULTIPLE_CELLS, returns true if the cells in the cell region are in the current selection.
DataGrid
  
If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns true if the row at index is in the current selection.
DataGrid
  
If selectionMode is GridSelectionMode.MULTIPLE_ROWS, returns true if the rows in indices are in the current selection.
DataGrid
 Inherited
Sizes the object.
UIComponent
 Inherited
setConstraintValue(constraintName:String, value:*):void
Sets a layout constraint value, which is the same as setting the constraint style for this component.
UIComponent
 Inherited
setCurrentState(stateName:String, playTransition:Boolean = true):void
Set the current state.
UIComponent
 Inherited
Sets the focus to this component.
UIComponent
 Inherited
setLayoutBoundsPosition(x:Number, y:Number, postLayoutTransform:Boolean = true):void
Sets the coordinates that the element uses to draw on screen.
UIComponent
 Inherited
setLayoutBoundsSize(width:Number, height:Number, postLayoutTransform:Boolean = true):void
Sets the layout size of the element.
UIComponent
 Inherited
setLayoutMatrix(value:Matrix, invalidateLayout:Boolean):void
Sets the transform Matrix that is used to calculate the component's layout size and position relative to its siblings.
UIComponent
 Inherited
setLayoutMatrix3D(value:Matrix3D, invalidateLayout:Boolean):void
Sets the transform Matrix3D that is used to calculate the component's layout size and position relative to its siblings.
UIComponent
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
setSelectedCell(rowIndex:int, columnIndex:int):Boolean
If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, sets the selection and the caret position to this cell.
DataGrid
  
If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, sets the selection and the caret position to this row.
DataGrid
 Inherited
setStyle(styleProp:String, newValue:*):void
Sets a style property on this component instance.
UIComponent
 Inherited
setVisible(value:Boolean, noEvent:Boolean = false):void
Called when the visible property changes.
UIComponent
  
sortByColumns(columnIndices:Vector.<int>, isInteractive:Boolean = false):Boolean
Sort the DataGrid by one or more columns, and refresh the display.
DataGrid
 Inherited
startDrag(lockCenter:Boolean = false, bounds:Rectangle = null):void
Lets the user drag the specified sprite.
Sprite
  
startItemEditorSession(rowIndex:int, columnIndex:int):Boolean
Starts an editor session on a selected cell in the grid.
DataGrid
 Inherited
startTouchDrag(touchPointID:int, lockCenter:Boolean = false, bounds:Rectangle = null):void
Lets the user drag the specified sprite on a touch-enabled device.
Sprite
 Inherited
Recursively stops the timeline execution of all MovieClips rooted at this object.
DisplayObjectContainer
 Inherited
Ends the startDrag() method.
Sprite
 Inherited
stopTouchDrag(touchPointID:int):void
Ends the startTouchDrag() method, for use with touch-enabled devices.
Sprite
 Inherited
Detects changes to style properties.
UIComponent
 Inherited
Flex calls the stylesInitialized() method when the styles for a component are first initialized.
UIComponent
 Inherited
[static] Blocks the background processing of methods queued by callLater(), until resumeBackgroundProcessing() is called.
UIComponent
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
[override] Returns a string indicating the location of this object within the hierarchy of DisplayObjects in the Application.
FlexSprite
 Inherited
transformAround(transformCenter:Vector3D, scale:Vector3D = null, rotation:Vector3D = null, translation:Vector3D = null, postLayoutScale:Vector3D = null, postLayoutRotation:Vector3D = null, postLayoutTranslation:Vector3D = null, invalidateLayout:Boolean = true):void
A utility method to update the rotation, scale, and translation of the transform while keeping a particular point, specified in the component's own coordinate space, fixed in the parent's coordinate space.
UIComponent
 Inherited
transformPointToParent(localPosition:Vector3D, position:Vector3D, postLayoutPosition:Vector3D):void
A utility method to transform a point specified in the local coordinates of this object to its location in the object's parent's coordinates.
UIComponent
 Inherited
Validates the position and size of children and draws other visuals.
UIComponent
 Inherited
Validate and update the properties and layout of this object and redraw it, if necessary.
UIComponent
 Inherited
Used by layout logic to validate the properties of a component by calling the commitProperties() method.
UIComponent
 Inherited
validateSize(recursive:Boolean = false):void
Validates the measured size of the component If the LayoutManager.invalidateSize() method is called with this ILayoutManagerClient, then the validateSize() method is called when it's time to do measurements.
UIComponent
 Inherited
Handles both the valid and invalid events from a validator assigned to this component.
UIComponent
 Inherited
Returns the primitive value of the specified object.
Object
 Inherited
Returns a box Matrix which can be passed to drawRoundRect() as the rot parameter when drawing a vertical gradient.
UIComponent
 Inherited
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Protected Methods
 MethodDefined By
 Inherited
Adjust the focus rectangle.
UIComponent
 Inherited
Commits the computed matrix built from the combination of the layout matrix and the transform offsets to the flash displayObject's transform.
UIComponent
 Inherited
This is an internal method used by the Flex framework to support the Dissolve effect.
UIComponent
 Inherited
Create the skin for the component.
SkinnableComponent
 Inherited
Determines if the call to the measure() method can be skipped.
UIComponent
 Inherited
Performs any final processing after child objects are created.
UIComponent
 Inherited
Clear out references to skin parts.
SkinnableComponent
  
commitCaretPosition(newCaretRowIndex:int, newCaretColumnIndex:int):void
Updates the grid's caret position.
DataGrid
  
commitInteractiveSelection(selectionEventKind:String, rowIndex:int, columnIndex:int, rowCount:int = 1, columnCount:int = 1):Boolean
In response to user input (mouse or keyboard) which changes the selection, this method dispatches the selectionChanging event.
DataGrid
 Inherited
Processes the properties set on the component.
UIComponent
 Inherited
Create child objects of the component.
UIComponent
 Inherited
Create an instance of a dynamic skin part.
SkinnableComponent
 Inherited
Creates a new object using a context based on the embedded font being used.
UIComponent
 Inherited
Creates the object using a given moduleFactory.
UIComponent
 Inherited
Destroys and removes the skin for this component.
SkinnableComponent
 Inherited
dispatchPropertyChangeEvent(prop:String, oldValue:*, value:*):void
Helper method for dispatching a PropertyChangeEvent when a property is updated.
UIComponent
 Inherited
Find the skin parts in the skin class and assign them to the properties of the component.
SkinnableComponent
 Inherited
The event handler called when a UIComponent object gets focus.
UIComponent
 Inherited
The event handler called when a UIComponent object loses focus.
UIComponent
 Inherited
[override] Returns the name of the state to be applied to the skin.
SkinnableContainerBase
 Inherited
Returns a specific instance of a dynamic part.
SkinnableComponent
 Inherited
Initializes the implementation and storage of some of the less frequently used advanced layout features of a component.
UIComponent
 Inherited
Finalizes the initialization of this component.
UIComponent
 Inherited
Initializes this component's accessibility code.
UIComponent
 Inherited
Helper method to invalidate parent size and display list if this object affects its layout (includeInLayout is true).
UIComponent
 Inherited
Typically overridden by components containing UITextField objects, where the UITextField object gets focus.
UIComponent
 Inherited
The event handler called for a keyDown event.
UIComponent
 Inherited
The event handler called for a keyUp event.
UIComponent
 Inherited
Calculates the default size, and optionally the default minimum size, of the component.
UIComponent
 Inherited
Returns the number of instances of a dynamic part.
SkinnableComponent
 Inherited
partAdded(partName:String, instance:Object):void
Called when a skin part is added.
SkinnableComponent
 Inherited
partRemoved(partName:String, instance:Object):void
Called when an instance of a skin part is being removed.
SkinnableComponent
 Inherited
Remove an instance of a dynamic part.
SkinnableComponent
 Inherited
This method is called when a UIComponent is constructed, and again whenever the ResourceManager dispatches a "change" Event to indicate that the localized resources have changed in some way.
UIComponent
 Inherited
setStretchXY(stretchX:Number, stretchY:Number):void
Specifies a transform stretch factor in the horizontal and vertical direction.
UIComponent
 Inherited
stateChanged(oldState:String, newState:String, recursive:Boolean):void
This method is called when a state changes to check whether state-specific styles apply to this component.
UIComponent
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
Draws the object and/or sizes and positions its children.
UIComponent
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 InheritedDispatched when the component is added to a container as a content child by using the addChild(), addChildAt(), addElement(), or addElementAt() method.UIComponent
 InheritedDispatched when a display object is added to the display list.DisplayObject
 InheritedDispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.DisplayObject
  Dispatched by the grid skin part when the caret position, size, or visibility has changed due to user interaction or being programmatically set.DataGrid
 InheritedDispatched when the user selects 'Clear' (or 'Delete') from the text context menu.InteractiveObject
 InheritedDispatched when a user presses and releases the main button of the user's pointing device over the same InteractiveObject.InteractiveObject
 Inherited
    contextMenu
Dispatched when a user gesture triggers the context menu associated with this interactive object in an AIR application.InteractiveObject
 InheritedDispatched when the user activates the platform-specific accelerator key combination for a copy operation or selects 'Copy' from the text context menu.InteractiveObject
 InheritedDispatched when the component has finished its construction, property processing, measuring, layout, and drawing.UIComponent
 InheritedDispatched after the view state has changed.UIComponent
 InheritedDispatched after the currentState property changes, but before the view state changes.UIComponent
 InheritedDispatched when the user activates the platform-specific accelerator key combination for a cut operation or selects 'Cut' from the text context menu.InteractiveObject
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
 InheritedDispatched when a user presses and releases the main button of a pointing device twice in rapid succession over the same InteractiveObject when that object's doubleClickEnabled flag is set to true.InteractiveObject
 InheritedDispatched by the drag initiator (the component that is the source of the data being dragged) when the drag operation completes, either when you drop the dragged data onto a drop target or when you end the drag-and-drop operation without performing a drop.UIComponent
 InheritedDispatched by the drop target when the user releases the mouse over it.UIComponent
 InheritedDispatched by a component when the user moves the mouse over the component during a drag operation.UIComponent
 InheritedDispatched by the component when the user drags outside the component, but does not drop the data onto the target.UIComponent
 InheritedDispatched by a component when the user moves the mouse while over the component during a drag operation.UIComponent
 InheritedDispatched by the drag initiator when starting a drag operation.UIComponent
 InheritedDispatched after an effect ends.UIComponent
 InheritedDispatched just before an effect starts.UIComponent
 InheritedDispatched after an effect is stopped, which happens only by a call to stop() on the effect.UIComponent
 Inherited[broadcast event] Dispatched when the playhead is entering a new frame.DisplayObject
 InheritedDispatched after the component has entered a view state.UIComponent
 Inherited[broadcast event] Dispatched when the playhead is exiting the current frame.DisplayObject
 InheritedDispatched just before the component exits a view state.UIComponent
 InheritedDispatched after a display object gains focus.InteractiveObject
 InheritedDispatched after a display object loses focus.InteractiveObject
 Inherited[broadcast event] Dispatched after the constructors of frame display objects have run but before frame scripts have run.DisplayObject
 InheritedDispatched when the user presses two points of contact over the same InteractiveObject instance on a touch-enabled device (such as presses and releases two fingers over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user moves a point of contact over the InteractiveObject instance on a touch-enabled device (such as moving a finger from left to right over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user performs a rotation gesture at a point of contact with an InteractiveObject instance (such as touching two fingers and rotating them over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user performs a swipe gesture at a point of contact with an InteractiveObject instance (such as touching three fingers to a screen and then moving them in parallel over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user creates a point of contact with an InteractiveObject instance, then taps on a touch-enabled device (such as placing several fingers over a display object to open a menu and then taps one finger to select a menu item on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user performs a zoom gesture at a point of contact with an InteractiveObject instance (such as touching two fingers to a screen and then quickly spreading the fingers apart over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
  Dispatched by the grid skin part when the mouse is clicked over a cell.DataGrid
  Dispatched by the grid skin part when the mouse is double-clicked over a cell.DataGrid
  Dispatched after the item editor has been closed without saving its data.DataGrid
  Dispatched after the data in item editor has been saved into the data provider and the editor has been closed.DataGrid
  Dispatched immediately after an item editor has been opened.DataGrid
  Dispatched when a new item editor session has been requested.DataGrid
  Dispatched by the grid skin part when the mouse button is pressed over a grid cell.DataGrid
  Dispatched by the grid skin part after a gridMouseDown event if the mouse moves before the button is released.DataGrid
  Dispatched by the grid skin part after a gridMouseDown event when the mouse button is released, even if the mouse is no longer within the grid.DataGrid
  Dispatched by the grid skin part when the mouse leaves a grid cell.DataGrid
  Dispatched by the grid skin part when the mouse enters a grid cell.DataGrid
 InheritedDispatched when an object's state changes from visible to invisible.UIComponent
 InheritedThis event is dispatched to any client app that supports inline input with an IMEInteractiveObject
 InheritedDispatched when the component has finished its construction and has all initialization properties set.UIComponent
 InheritedDispatched when a component is monitored by a Validator and the validation failed.UIComponent
 InheritedDispatched when the user presses a key.InteractiveObject
 InheritedDispatched when the user attempts to change focus by using keyboard navigation.InteractiveObject
 InheritedDispatched when the user releases a key.InteractiveObject
 InheritedDispatched when a user presses and releases the middle button of the user's pointing device over the same InteractiveObject.InteractiveObject
 InheritedDispatched when a user presses the middle pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user presses the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched from a component opened using the PopUpManager when the user clicks outside it.UIComponent
 InheritedDispatched when the user attempts to change focus by using a pointer device.InteractiveObject
 InheritedDispatched when a user moves the pointing device while it is over an InteractiveObject.InteractiveObject
 InheritedDispatched when the user moves a pointing device away from an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user moves a pointing device over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a mouse wheel is spun over an InteractiveObject instance.InteractiveObject
 InheritedDispatched from a component opened using the PopUpManager when the user scrolls the mouse wheel outside it.UIComponent
 InheritedDispatched when the object has moved.UIComponent
 InheritedDispatched by the drag initiator InteractiveObject when the user releases the drag gesture.InteractiveObject
 InheritedDispatched by the target InteractiveObject when a dragged object is dropped on it and the drop has been accepted with a call to DragManager.acceptDragDrop().InteractiveObject
 InheritedDispatched by an InteractiveObject when a drag gesture enters its boundary.InteractiveObject
 InheritedDispatched by an InteractiveObject when a drag gesture leaves its boundary.InteractiveObject
 InheritedDispatched by an InteractiveObject continually while a drag gesture remains within its boundary.InteractiveObject
 InheritedDispatched at the beginning of a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call.InteractiveObject
 InheritedDispatched during a drag operation by the InteractiveObject that is specified as the drag initiator in the DragManager.doDrag() call.InteractiveObject
 InheritedDispatched when the user activates the platform-specific accelerator key combination for a paste operation or selects 'Paste' from the text context menu.InteractiveObject
 InheritedDispatched at the beginning of the component initialization sequence.UIComponent
 InheritedDispatched when the user lowers an active stylus past the proximity detection threshold of the screen.InteractiveObject
 Inherited
    proximityEnd
Dispatched when the user lifts an active stylus above the proximity detection threshold of the screen.InteractiveObject
 InheritedDispatched when the user moves an active stylus over the screen while remaining within the proximity detection threshold.InteractiveObject
 Inherited
    proximityOut
Dispatched when the user moves an active stylus away from this InteractiveObject while remaining within the proximity detection threshold of the screen.InteractiveObject
 InheritedDispatched when the user moves an active stylus directly above this InteractiveObject while remaining within the proximity detection threshold of the screen.InteractiveObject
 InheritedDispatched when the user moves an active stylus away from this InteractiveObject and any of its children while remaining within the proximity detection threshold of the screen.InteractiveObject
 InheritedDispatched when the user moves an active stylus over this InteractiveObject from outside the object's tree of descendents in the display list (while remaining within the proximity detection threshold of the screen).InteractiveObject
 InheritedDispatched when a user releases the button on the pointing device after the user first pressed the button over an InteractiveObject instance and then moved the pointing device off of the InteractiveObject instance.InteractiveObject
 InheritedDispatched when the component is removed from a container as a content child by using the removeChild(), removeChildAt(), removeElement(), or removeElementAt() method.UIComponent
 InheritedDispatched when a display object is about to be removed from the display list.DisplayObject
 InheritedDispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.DisplayObject
 Inherited[broadcast event] Dispatched when the display list is about to be updated and rendered.DisplayObject
 InheritedDispatched when the component is resized.UIComponent
 InheritedDispatched when a user presses and releases the right button of the user's pointing device over the same InteractiveObject.InteractiveObject
 InheritedDispatched when a user presses the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when a user releases the pointing device button over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user moves a pointing device away from an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user moves a pointing device over an InteractiveObject instance.InteractiveObject
 InheritedDispatched when the user activates the platform-specific accelerator key combination for a select all operation or selects 'Select All' from the text context menu.InteractiveObject
  Dispatched when the selection has changed.DataGrid
  Dispatched when the selection is going to change.DataGrid
 InheritedDispatched when an object's state changes from invisible to visible.UIComponent
 InheritedDispatched immediately after the soft keyboard is raised.InteractiveObject
 InheritedDispatched immediately before the soft keyboard is raised.InteractiveObject
 InheritedDispatched immediately after the soft keyboard is lowered.InteractiveObject
  Dispatched after the sort has been applied to the data provider's collection.DataGrid
  Dispatched before the sort has been applied to the data provider's collection.DataGrid
 InheritedDispatched after the component has entered a new state and any state transition animation to that state has finished playing.UIComponent
 InheritedDispatched when a component interrupts a transition to its current state in order to switch to a new state.UIComponent
 InheritedDispatched when the value of the object's tabChildren flag changes.InteractiveObject
 InheritedDispatched when the object's tabEnabled flag changes.InteractiveObject
 InheritedDispatched when the value of the object's tabIndex property changes.InteractiveObject
 InheritedDispatched when a user enters one or more characters of text.InteractiveObject
 InheritedDispatched by the component when it is time to create a ToolTip.UIComponent
 InheritedDispatched by the component when its ToolTip has been hidden and is to be discarded soon.UIComponent
 InheritedDispatched by the component when its ToolTip is about to be hidden.UIComponent
 InheritedDispatched by the component when its ToolTip is about to be shown.UIComponent
 InheritedDispatched by the component when its ToolTip has been shown.UIComponent
 InheritedDispatched by a component whose toolTip property is set, as soon as the user moves the mouse over it.UIComponent
 InheritedDispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedA non-cancellable event, dispatched by a component when it is done responding to a touch interaction user gesture.UIComponent
 InheritedA non-cancellable event, dispatched by a component when it starts responding to a touch interaction user gesture.UIComponent
 InheritedA cancellable event, dispatched by a component in an attempt to respond to a touch interaction user gesture.UIComponent
 InheritedDispatched when the user touches the device, and is continuously dispatched until the point of contact is removed.InteractiveObject
 InheritedDispatched when the user moves the point of contact away from InteractiveObject instance on a touch-enabled device (such as drags a finger from one display object to another on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user moves the point of contact over an InteractiveObject instance on a touch-enabled device (such as drags a finger from a point outside a display object to a point over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user moves the point of contact away from an InteractiveObject instance on a touch-enabled device (such as drags a finger from over a display object to a point outside the display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user moves the point of contact over an InteractiveObject instance on a touch-enabled device (such as drags a finger from a point outside a display object to a point over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when the user lifts the point of contact over the same InteractiveObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen).InteractiveObject
 InheritedDispatched when an object has had its commitProperties(), measure(), and updateDisplayList() methods called (if needed).UIComponent
 InheritedDispatched when a component is monitored by a Validator and the validation succeeded.UIComponent
 InheritedDispatched when values are changed programmatically or by user interaction.UIComponent
Styles

Styles are either common or associated with a specific theme. If the style is common, it can be used with any theme. If a style is associated with a specific theme, it can only be used if your application uses that theme.

Common Styles
 Style Description Defined By
  
alignmentBaseline
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Specifies the baseline to which the dominant baseline aligns.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.alignmentBaseline

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

The vertical distance in pixels from the top edge of the content area to the control's baseline position.
UIComponent
  
baselineShift
Type: Object CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Amount to shift the baseline.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.baselineShift.

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

The vertical distance, in pixels, from the bottom edge of the component to the bottom edge of its parent container's content area.
UIComponent
  
cffHinting
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The type of CFF hinting used for this text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.cffHinting.

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
color
Type: uint Format: Color CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Color of the text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.color.

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style color, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style color.

The default value is 0x000000.

Related API Elements

DataGrid
  
defaultDataGridItemEditor
Type: Class CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The class to use as the item editor, if one is not specified by a column. This style property lets you set an item editor for a group of DataGrid controls instead of having to set each one individually. The DataGridColumn.itemEditor property supercedes this value. The default value is null.
DataGrid
  
digitCase
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The type of digit case used for this text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.digitCase.

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
digitWidth
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Type of digit width used for this text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.digitWidth.

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
direction
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Specifies the default bidirectional embedding level of the text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.direction.

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
dominantBaseline
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Specifies which element baseline snaps to the alignmentBaseline to determine the vertical position of the element on the line.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.dominantBaseline.

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
 InheritedType: uint Format: Color CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

Color of the component highlight when validation fails.
UIComponent
 InheritedType: Class
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Name of the skin class to use for this component when a validation error occurs.
SkinnableComponent
 InheritedType: Class CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

Skin used to draw the focus rectangle.
UIComponent
  
fontFamily
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The name of the font to use, or a comma-separated list of font names.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontFamily.

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontFamily, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontFamily.

The default value for the Spark theme is Arial. The default value for the Mobile theme is _sans.

Related API Elements

DataGrid
  
fontLookup
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Font lookup to use.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontLookup

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
fontSize
Type: Number Format: Length CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Height of the text, in pixels.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontSize

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontSize, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontSize.

The default value for the Spark theme is 12. The default value for the Mobile theme is 24.

Related API Elements

DataGrid
  
fontStyle
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Determines whether the text is italic font.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontStyle

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontStyle, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontStyle.

Related API Elements

DataGrid
  
fontWeight
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Determines whether the text is boldface.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.fontWeight

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style fontWeight, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style fontWeight.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

The horizontal distance in pixels from the center of the component's content area to the center of the component.
UIComponent
  
horizontalScrollPolicy
Type: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

Indicates the conditions for which the horizontal scroll bar is displayed.
  • ScrollPolicy.ON ("on") - The scroll bar is always displayed.
  • ScrollPolicy.OFF ("off") - The scroll bar is never displayed. The viewport can still be scrolled programmatically, by setting its horizontalScrollPosition property.
  • ScrollPolicy.AUTO ("auto") - The scroll bar is displayed when the viewport's contentWidth is larger than its width.

The scroll policy affects the measured size of the scroller skin part. This style is a reference to the scroller skin part's horizontalScrollPolicy style. It is not an inheriting style Therefor, for example, it will not affect item renderers.

The default value is ScrollPolicy.AUTO.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The primary interaction mode for this component.
UIComponent
  
justificationRule
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Rule used to justify text in a paragraph.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.justificationRule

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
justificationStyle
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The style used for justification of the paragraph.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.justificationStyle

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
kerning
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The style used for justification of the paragraph.

Kerning is enabled by default for Spark components, but is disabled by default for MX components. Spark components interpret default as auto, while MX components interpret default as false.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.kerning

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4.1  Runtime Versions: Flash10, AIR 1.5

Specifies the desired layout direction of a component.
UIComponent
 InheritedType: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

The horizontal distance, in pixels, from the left edge of the component to the left edge of its parent container's content area.
UIComponent
  
ligatureLevel
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Controls which of the ligatures that are defined in the font may be used in the text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.ligatureLevel

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
lineHeight
Type: Object CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Leading controls for the text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.lineHeight.

For the Mobile theme, this is not supported. See leading.

Related API Elements

DataGrid
  
lineThrough
Type: Boolean CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

If true, applies strikethrough, a line drawn through the middle of the text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.lineThrough

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
locale
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The locale of the text. Controls case transformations and shaping. Uses standard locale identifiers as described in Unicode Technical Standard #35. For example "en", "en_US" and "en-US" are all English, "ja" is Japanese.

The default value is undefined. This property inherits its value from an ancestor; if still undefined, it inherits from the global locale style. During the application initialization, if the global locale style is undefined, then the default value is set to "en".

When using the Spark formatters and globalization classes, you can set this style on the root application to the value of the LocaleID.DEFAULT constant. Those classes will then use the client operating system's international preferences.

The default value is undefined.

Learn more

DataGrid
  
renderingMode
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The rendering mode used for this text which applies only to embedded fonts.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.renderingMode

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

The horizontal distance, in pixels, from the right edge of the component to the right edge of its parent container's content area.
UIComponent
 InheritedType: Boolean CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 1.5

Show the error border or skin when this component is invalid
UIComponent
 InheritedType: Boolean CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 1.5

Show the error tip when this component is invalid and the user rolls over it
UIComponent
 InheritedType: Class
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Name of the skin class to use for this component.
SkinnableComponent
  
stretchCursor
Type: Class CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The class to use as the skin for the cursor that indicates that a column can be resized. The default value is the cursorStretch symbol from the Assets.swf file.
DataGrid
  
textAlign
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Alignment of text within a container.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textAlign

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style textAlign, and if using StyleableStageText, see spark.components.supportClasses.StyleableStageText Style textAlign.

Related API Elements

DataGrid
  
textAlignLast
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Alignment of the last line in the paragraph relative to the container in justified text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textAlignLast

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
textAlpha
Type: Number CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Alpha (transparency) value for the text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textAlpha

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
textDecoration
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Determines whether the text is underlined.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textDecoration

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField Style textDecoration, and if using StyleableStageText, this is not supported.

Related API Elements

DataGrid
  
textJustify
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

Specifies options for justifying text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.textJustify

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

The vertical distance, in pixels, from the top edge of the component to the top edge of its parent container's content area.
UIComponent
  
trackingLeft
Type: Object CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The amount of tracking (manual kerning) to be applied to the left of each character.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.trackingLeft

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
trackingRight
Type: Object CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The amount of tracking (manual kerning) to be applied to the right of each character.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.trackingRight

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
  
typographicCase
Type: String CSS Inheritance: Yes
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The type of typographic case used for this text.

For the Spark theme, see flashx.textLayout.formats.ITextLayoutFormat.typographicCase

For the Mobile theme, this is not supported.

Related API Elements

DataGrid
 InheritedType: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 3  Runtime Versions: Flash9, AIR 1.1

The vertical distance in pixels from the center of the component's content area to the center of the component.
UIComponent
  
verticalScrollPolicy
Type: String CSS Inheritance: No
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

Indicates under what conditions the vertical scroll bar is displayed.
  • ScrollPolicy.ON ("on") - The scroll bar is always displayed.
  • ScrollPolicy.OFF ("off") - The scroll bar is never displayed. The viewport can still be scrolled programmatically, by setting its verticalScrollPosition property.
  • ScrollPolicy.AUTO ("auto") - The scroll bar is displayed when the viewport's contentHeight is larger than its height.

The scroll policy affects the measured size of the scroller skin part. This style is a reference to the scroller skin part's verticalScrollPolicy style. It is not an inheriting style Therefor, for example, it will not affect item renderers.

The default value is ScrollPolicy.AUTO.

Related API Elements

DataGrid
Spark Theme Styles
 Style Description Defined By
  
alternatingRowColors
Type: Array Format: Color CSS Inheritance: No Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

Used to initialize the DataGrid's rowBackground skin part. If the alternatingRowColors style is specified, then use the alternatingRowColorsBackground skin part as the value of the rowBackground skin part. The alternating colors for the grid rows are defined by successive entries in the Array value of this style.

If you want to change how this style is rendered, replace the alternatingRowColorsBackground skin part in the DataGridSkin class. If you want to specify the background for each row, then initialize the rowBackground skin part directly.

The default value is undefined.
DataGrid
  
borderAlpha
Type: Number CSS Inheritance: No Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The alpha value of the border for this component. Valid values are 0.0 to 1.0. The default value is 1.0.
DataGrid
  
borderColor
Type: uint Format: Color CSS Inheritance: No Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The color of the border for this component. The default value is #696969.
DataGrid
  
borderVisible
Type: Boolean CSS Inheritance: No Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

Controls the visibility of the border for this component. The default value is true.
DataGrid
  
caretColor
Type: uint Format: Color CSS Inheritance: Yes Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.0

Color of the caret indicator when navigating the Grid. The default value is 0x0167FF.
DataGrid
 InheritedType: uint Format: Color CSS Inheritance: Yes Theme: spark, mobile
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The main color for a component.
SkinnableComponent
  
contentBackgroundAlpha
Type: Number CSS Inheritance: Yes Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The alpha of the content background for this component. Valid values are 0.0 to 1.0.
DataGrid
  
contentBackgroundColor
Type: uint Format: Color CSS Inheritance: Yes Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The color of the content background for this component.

For a List, changing contentBackgroundColor will change the content background color of the List; however, if the item renderer is opaque, the user may not see any difference. The item renderer's color is affected by alternatingItemColors. In the Spark theme, by default, item renderers are transparent (alternatingItemColors = undefined); however, in the Mobile theme, item renderers are opaque by default (alternatingItemColors = 0xFFFFFF).

The default value for the Spark theme is 0xFFFFFF. The default value for the Mobile theme is 0xF0F0F0.

DataGrid
  
rollOverColor
Type: uint Format: Color CSS Inheritance: Yes Theme: spark
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.0

Color of the highlights when the mouse is over the component.

This style is only applicable in mouse interactionMode.

The default value is 0xCEDBEF.
DataGrid
  
selectionColor
Type: uint Format: Color CSS Inheritance: Yes Theme: spark, mobile
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.0

The color of the background of a renderer when the user selects it.

The default value for the Halo theme is 0x7FCEFF. The default value for the Spark theme is 0xA8C6EE. The default value for the Mobile theme is 0xE0E0E0.

DataGrid
  
symbolColor
Type: uint Format: Color CSS Inheritance: Yes Theme: spark, mobile
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.0

Color of any symbol of a component. Examples include the check mark of a CheckBox or the arrow of a scroll button. The default value is 0x000000.
DataGrid
Mobile Theme Styles
 Style Description Defined By
 InheritedType: uint Format: Color CSS Inheritance: Yes Theme: spark, mobile
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5

The main color for a component.
SkinnableComponent
  
leading
Type: Number Format: Length CSS Inheritance: Yes Theme: mobile
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10.1, AIR 2.0

Additional vertical space between lines of text.

For the Spark theme, this is not supported. See lineHeight.

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableStageText Style fontWeight and if using StyleableStageText, this is not supported.

Related API Elements

DataGrid
  
letterSpacing
Type: Number CSS Inheritance: Yes Theme: mobile
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10.1, AIR 2.0

The number of additional pixels to appear between each character.

For the Spark theme, this is not supported. See trackingLeft and trackingRight.

For the Mobile theme, if using StyleableTextField, see spark.components.supportClasses.StyleableTextField.letterSpacing and if using StyleableStageText, this is not supported.

Related API Elements

DataGrid
  
selectionColor
Type: uint Format: Color CSS Inheritance: Yes Theme: spark, mobile
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.0

The color of the background of a renderer when the user selects it.

The default value for the Halo theme is 0x7FCEFF. The default value for the Spark theme is 0xA8C6EE. The default value for the Mobile theme is 0xE0E0E0.

DataGrid
  
symbolColor
Type: uint Format: Color CSS Inheritance: Yes Theme: spark, mobile
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.0

Color of any symbol of a component. Examples include the check mark of a CheckBox or the arrow of a scroll button. The default value is 0x000000.
DataGrid
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
  
alternatingRowColorsBackground:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to render the alternatingRowColors style.

The IFactory must return an object of type IVisualElement.
DataGrid
  
caretIndicator:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to render the grid's caret indicator.

The IFactory must return an object of type IVisualElement.
DataGrid
  
columnHeaderGroup:GridColumnHeaderGroup
Required: false Part Type: Static
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

A reference to the GridColumnHeaderGroup object that displays the column headers.
DataGrid
  
columnSeparator:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to render the vertical separator between columns.

The IFactory must return an object of type IVisualElement.
DataGrid
  
editorIndicator:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to render a background behind item renderers that are being edited. Item renderers may only be edited when the data grid and the column are both editable and the column sets rendererIsEditable to true.

The IFactory must return an object of type IVisualElement.
DataGrid
  
grid:Grid
Required: false Part Type: Static
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

A reference to the Grid control that displays row and columns.
DataGrid
  
hoverIndicator:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to provide hover feedback.

The IFactory must return an object of type IVisualElement.
DataGrid
  
rowBackground:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to render the background of each row.

The IFactory must return an object of type IVisualElement.
DataGrid
  
rowSeparator:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to render the horizontal separator between header rows.

The IFactory must return an object of type IVisualElement.
DataGrid
  
scroller:Scroller
Required: false Part Type: Static
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

A reference to the Scroller control in the skin class that adds scroll bars to the DataGrid control.
DataGrid
  
selectionIndicator:IFactory
Required: false Part Type: Dynamic
Language Version: ActionScript 3.0  Product Version: Flex 4.5  Runtime Versions: Flash10, AIR 2.5

The IVisualElement class used to render selected rows or cells.

The IFactory must return an object of type IVisualElement.
DataGrid
Skin States

To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.


 Skin State Description Defined By
 Inherited Disabled State
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5
SkinnableContainerBase
 Inherited Normal State
Language Version: ActionScript 3.0  Product Version: Flex 4  Runtime Versions: Flash10, AIR 1.5
SkinnableContainerBase
Effects
 Effect Description Defined By
 Inherited Triggering Event: added
Played when the component is added as a child to a Container.
UIComponent
 Inherited Triggering Event: creationComplete
Played when the component is created.
UIComponent
 Inherited Triggering Event: focusIn
Played when the component gains keyboard focus.
UIComponent
 Inherited Triggering Event: focusOut
Played when the component loses keyboard focus.
UIComponent
 Inherited Triggering Event: hide
Played when the component becomes invisible.
UIComponent
 Inherited Triggering Event: mouseDown
Played when the user presses the mouse button while over the component.
UIComponent
 Inherited Triggering Event: mouseUp
Played when the user releases the mouse button while over the component.
UIComponent
 Inherited Triggering Event: move
Played when the component is moved.
UIComponent
 Inherited Triggering Event: removed
Played when the component is removed from a Container.
UIComponent
 Inherited Triggering Event: resize
Played when the component is resized.
UIComponent
 Inherited Triggering Event: rollOut
Played when the user rolls the mouse so it is no longer over the component.
UIComponent
 Inherited Triggering Event: rollOver
Played when the user rolls the mouse over the component.
UIComponent
 Inherited Triggering Event: show
Played when the component becomes visible.
UIComponent
Public Constants
 ConstantDefined By
Property Detail

columns

property
columns:IList

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The list of GridColumn objectss displayed by this grid. Each column selects different data provider item properties to display.

GridColumn objects can only appear in the columns for a single Grid control.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the columnsChanged event.



Implementation
    public function get columns():IList
    public function set columns(value:IList):void

columnsLength

property 
columnsLength:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Returns the value of columns.length if the columns IList was specified, otherwise 0.



Implementation
    public function get columnsLength():int

dataProvider

property 
dataProvider:IList

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

A list of data items that correspond to the rows in the grid. Each grid column is associated with a property of the data items to display that property in the grid cells.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the dataProviderChanged event.



Implementation
    public function get dataProvider():IList
    public function set dataProvider(value:IList):void

dataProviderLength

property 
dataProviderLength:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Returns the value of dataProvider.length if the dataProvider IList was specified, otherwise 0.



Implementation
    public function get dataProviderLength():int

dataTipField

property 
dataTipField:String

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The name of the field in the data provider to display as the datatip. By default, if showDataTips is true, the associated grid control looks for a property named label on each data provider item and displays it. However, if the data provider does not contain a label property, you can set the dataTipField property to specify a different property name. For example, you could set the value to "FullName" when a user views a set of people's names included from a database.

GridColumn.dataTipField takes precedence over this property.

If this column or its grid specifies a value for the dataTipFunction property, then the dataTipField property is ignored.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the dataTipFieldChanged event.



Implementation
    public function get dataTipField():String
    public function set dataTipField(value:String):void

dataTipFunction

property 
dataTipFunction:Function

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Specifies a callback function to run on each item of the data provider to determine its data tip. This property is used by the itemToDataTip method.

By default, if showDataTips is true, the column looks for a property named label on each data provider item and displays it as its data tip. However, some data providers do not have a label property nor do they have another property that you can use for displaying data in the rows.

For example, you have a data provider that contains a lastName and firstName fields, but you want to display full names as the data tip. You can specify a function to the dataTipFunction property that returns a single String containing the value of both fields. You can also use the dataTipFunction property for handling formatting and localization.

The signature of the dataTipFunction function must match the following:

dataTipFunction(item:Object, column:GridColumn):String
The item parameter is the data provider item for an entire row. The second parameter is this column object.

A typical function might concatenate an item's firstName and lastName properties, or do some custom formatting on a Date value property.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the dataTipFunctionChanged event.



Implementation
    public function get dataTipFunction():Function
    public function set dataTipFunction(value:Function):void

editable

property 
editable:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The default value for the GridColumn editable property, which indicates if a corresponding cell's data provider item can be edited. If true, clicking on a selected cell opens an item editor. You can enable or disable editing per cell (rather than per column) by handling the startItemEditorSession event. In the event handler, add the necessary logic to determine if the cell should be editable.

The default value is false.



Implementation
    public function get editable():Boolean
    public function set editable(value:Boolean):void

editorColumnIndex

property 
editorColumnIndex:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The zero-based column index of the cell that is being edited. The value is -1 if no cell is being edited.

The default value is -1.



Implementation
    public function get editorColumnIndex():int

editorRowIndex

property 
editorRowIndex:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The zero-based row index of the cell that is being edited. The value is -1 if no cell is being edited.

The default value is -1.



Implementation
    public function get editorRowIndex():int

enableIME

property 
enableIME:Boolean  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

A flag that indicates whether the IME should be enabled when the component receives focus. If the item editor is open, it sets this property accordingly.



Implementation
    public function get enableIME():Boolean

imeMode

property 
imeMode:String

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The default value for the GridColumn imeMode property, which specifies the IME (Input Method Editor) mode. The IME enables users to enter text in Chinese, Japanese, and Korean. Flex sets the specified IME mode when the control gets focus, and sets it back to the previous value when the control loses focus.

The flash.system.IMEConversionMode class defines constants for the valid values for this property. You can also specify null to specify no IME.

The default value is null.



Implementation
    public function get imeMode():String
    public function set imeMode(value:String):void

Related API Elements

itemEditor

property 
itemEditor:IFactory

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The default value for the GridColumn itemEditor property, which specifies the IGridItemEditor class used to create item editor instances.

The default value is null..

This property can be used as the source for data binding. When this property is modified, it dispatches the itemEditorChanged event.



Implementation
    public function get itemEditor():IFactory
    public function set itemEditor(value:IFactory):void

Related API Elements

itemEditorInstance

property 
itemEditorInstance:IGridItemEditor  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

A reference to the currently active instance of the item editor, if it exists.

To access the item editor instance and the new item value when an item is being edited, you use the itemEditorInstance property. The itemEditorInstance property is not valid until the itemEditorSessionStart event is dispatched.

The DataGridColumn.itemEditor property defines the class of the item editor and, therefore, the data type of the item editor instance.

Do not set this property in MXML.



Implementation
    public function get itemEditorInstance():IGridItemEditor

itemRenderer

property 
itemRenderer:IFactory

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The item renderer that's used for columns that do not specify one.

The default value is DefaultGridItemRenderer.

This property can be used as the source for data binding. When this property is modified, it dispatches the itemRendererChanged event.



Implementation
    public function get itemRenderer():IFactory
    public function set itemRenderer(value:IFactory):void

Related API Elements

preserveSelection

property 
preserveSelection:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If true, the selection is preserved when the data provider refreshes its collection. Because this refresh requires each item in the selection to be saved, this action is not desirable if the selection is large.

The default value is true.



Implementation
    public function get preserveSelection():Boolean
    public function set preserveSelection(value:Boolean):void

requestedColumnCount

property 
requestedColumnCount:int

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The measured width of this grid is large enough to display the first requestedColumnCount columns. If requestedColumnCount is -1, then the measured width is big enough for all of the columns.

If the actual size of the grid has been explicitly set, then this property has no effect.

The default value is -1.



Implementation
    public function get requestedColumnCount():int
    public function set requestedColumnCount(value:int):void

requestedMaxRowCount

property 
requestedMaxRowCount:int

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The measured height of the grid is large enough to display no more than requestedMaxRowCount rows.

This property has no effect if any of the following are true;

  • requestedRowCount is set.
  • The actual size of the grid has been explicitly set.

The default value is 10.



Implementation
    public function get requestedMaxRowCount():int
    public function set requestedMaxRowCount(value:int):void

requestedMinColumnCount

property 
requestedMinColumnCount:int

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The measured width of this grid is large enough to display at least requestedMinColumnCount columns.

This property has no effect if any of the following are true;

  • requestedColumnCount is set.
  • The actual size of the grid has been explicitly set.
  • The grid is inside a Scroller component.

The default value is -1.



Implementation
    public function get requestedMinColumnCount():int
    public function set requestedMinColumnCount(value:int):void

requestedMinRowCount

property 
requestedMinRowCount:int

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The measured height of this grid is large enough to display at least requestedMinRowCount rows.

This property has no effect if any of the following are true;

  • requestedRowCount is set.
  • The actual size of the grid has been explicitly set.

The default value is -1.



Implementation
    public function get requestedMinRowCount():int
    public function set requestedMinRowCount(value:int):void

requestedRowCount

property 
requestedRowCount:int

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The measured height of this grid is large enough to display the first requestedRowCount rows.

If requestedRowCount is -1, then the measured size will be big enough for all of the layout elements.

If the actual size of the grid has been explicitly set, then this property has no effect.

The default value is -1.



Implementation
    public function get requestedRowCount():int
    public function set requestedRowCount(value:int):void

requireSelection

property 
requireSelection:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If true and the selectionMode property is not GridSelectionMode.NONE, an item must always be selected in the grid.

The default value is false.



Implementation
    public function get requireSelection():Boolean
    public function set requireSelection(value:Boolean):void

resizableColumns

property 
resizableColumns:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Indicates whether the user can change the size of the columns. If true, the user can stretch or shrink the columns of the DataGrid control by dragging the grid lines between the header cells. If true, individual columns must also have their resizable properties set to false to prevent the user from resizing a particular column.

The default value is true.

This property can be used as the source for data binding. When this property is modified, it dispatches the resizableColumnsChanged event.



Implementation
    public function get resizableColumns():Boolean
    public function set resizableColumns(value:Boolean):void

rowHeight

property 
rowHeight:Number

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If variableRowHeight is false, then this property specifies the actual height of each row, in pixels.

If variableRowHeight is true, the value of this property is used as the estimated height for rows that haven't been scrolled into view yet, rather than the preferred height of renderers configured with the typicalItem. Similarly, when the Grid pads its display with empty rows, this property specifies the empty rows' height.

If variableRowHeight is false, the default value of this property is the maximum preferred height of the per-column renderers created for the typicalItem.

This property can be used as the source for data binding. When this property is modified, it dispatches the rowHeightChanged event.



Implementation
    public function get rowHeight():Number
    public function set rowHeight(value:Number):void

selectedCell

property 
selectedCell:CellPosition

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, returns the first selected cell starting at row 0 column 0 and progressing through each column in a row before moving to the next row.

When the user changes the selection by interacting with the control, the control dispatches the selectionChange event. When the user changes the selection programmatically, the control dispatches the valueCommit event.

This property is intended be used to initialize or bind to the selection in MXML markup. The setSelectedCell() method should be used for programatic selection updates, for example when writing a keyboard or mouse event handler.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the valueCommit event.



Implementation
    public function get selectedCell():CellPosition
    public function set selectedCell(value:CellPosition):void

selectedCells

property 
selectedCells:Vector.<CellPosition>

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, returns a Vector of CellPosition objects representing the positions of the selected cells in the grid.

When the user changes the selection by interacting with the control, the control dispatches the selectionChange event. When the user changes the selection programmatically, the control dispatches the valueCommit event.

This property is intended be used to initialize or bind to the selection in MXML markup. The setSelectedCell() method should be used for programatic selection updates, for example when writing a keyboard or mouse event handler.

The default value is an empty Vector.<CellPosition>

This property can be used as the source for data binding. When this property is modified, it dispatches the valueCommit event.



Implementation
    public function get selectedCells():Vector.<CellPosition>
    public function set selectedCells(value:Vector.<CellPosition>):void

selectedIndex

property 
selectedIndex:int

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns the rowIndex of the first selected row.

When the user changes the selection by interacting with the control, the control dispatches the selectionChange event. When the user changes the selection programmatically, the control dispatches the valueCommit event.

This property is intended be used to initialize or bind to the selection in MXML markup. The setSelectedCell() method should be used for programatic selection updates, for example when writing a keyboard or mouse event handler.

The default value is -1.

This property can be used as the source for data binding. When this property is modified, it dispatches the valueCommit event.



Implementation
    public function get selectedIndex():int
    public function set selectedIndex(value:int):void

selectedIndices

property 
selectedIndices:Vector.<int>

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns a Vector of the selected rows indices. For all other selection modes, this method has no effect.

When the user changes the selection by interacting with the control, the control dispatches the selectionChange event. When the user changes the selection programmatically, the control dispatches the valueCommit event.

This property is intended be used to initialize or bind to the selection in MXML markup. The setSelectedCell() method should be used for programatic selection updates, for example when writing a keyboard or mouse event handler.

>

The default value is an empty Vector.<int>

This property can be used as the source for data binding. When this property is modified, it dispatches the valueCommit event.



Implementation
    public function get selectedIndices():Vector.<int>
    public function set selectedIndices(value:Vector.<int>):void

selectedItem

property 
selectedItem:Object

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns the item in the the data provider that is currently selected or undefined if no rows are selected.

When the user changes the selection by interacting with the control, the control dispatches the selectionChange event. When the user changes the selection programmatically, the control dispatches the valueCommit event.

This property is intended be used to initialize or bind to the selection in MXML markup. The setSelectedCell() method should be used for programatic selection updates, for example when writing a keyboard or mouse event handler.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the valueCommit event.



Implementation
    public function get selectedItem():Object
    public function set selectedItem(value:Object):void

selectedItems

property 
selectedItems:Vector.<Object>

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns a Vector of the dataProvider items that are currently selected.

When the user changes the selection by interacting with the control, the control dispatches the selectionChange event. When the user changes the selection programmatically, the control dispatches the valueCommit event.

This property is intended be used to initialize or bind to the selection in MXML markup. The setSelectedCell() method should be used for programatic selection updates, for example when writing a keyboard or mouse event handler.

The default value is an empty Vector.<Object>

This property can be used as the source for data binding. When this property is modified, it dispatches the valueCommit event.



Implementation
    public function get selectedItems():Vector.<Object>
    public function set selectedItems(value:Vector.<Object>):void

selectionLength

property 
selectionLength:int  [read-only]

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns the number of selected rows. If selectionMode is GridSelectionMode.SINGLE_CELLS or GridSelectionMode.MULTIPLE_CELLS, returns the number of selected cells.

This property can be used as the source for data binding. When this property is modified, it dispatches the valueCommit event.



Implementation
    public function get selectionLength():int

selectionMode

property 
selectionMode:String

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The selection mode of the control. Possible values are: GridSelectionMode.MULTIPLE_CELLS, GridSelectionMode.MULTIPLE_ROWS, GridSelectionMode.NONE, GridSelectionMode.SINGLE_CELL, and GridSelectionMode.SINGLE_ROW.

Changing the selectionMode causes the current selection to be cleared and the caretRowIndex and caretColumnIndex to be set to -1.

The default value is GridSelectionMode.SINGLE_ROW.

This property can be used as the source for data binding. When this property is modified, it dispatches the selectionModeChanged event.



Implementation
    public function get selectionMode():String
    public function set selectionMode(value:String):void

Related API Elements

showDataTips

property 
showDataTips:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If true then a dataTip is displayed for all visible cells. If false, the default, then a dataTip is only displayed if the column's showDataTips property is true.

The default value is false.

This property can be used as the source for data binding. When this property is modified, it dispatches the showDataTipsChanged event.



Implementation
    public function get showDataTips():Boolean
    public function set showDataTips(value:Boolean):void

sortableColumns

property 
sortableColumns:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Specifies whether the user can interactively sort columns. If true, the user can sort the data provider by the data field of a column by clicking on the column's header. If true, an individual column can set its sortable property to false to prevent the user from sorting by that column.

The default value is true.

This property can be used as the source for data binding. When this property is modified, it dispatches the sortableColumnsChanged event.



Implementation
    public function get sortableColumns():Boolean
    public function set sortableColumns(value:Boolean):void

typicalItem

property 
typicalItem:Object

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

The grid's layout ensures that columns whose width is not specified is wide enough to display an item renderer for this default data provider item. If a typical item is not specified, then the first data provider item is used.

Restriction: if the typicalItem is an IVisualItem, it must not also be a member of the data provider.

The default value is null.

This property can be used as the source for data binding. When this property is modified, it dispatches the typicalItemChanged event.



Implementation
    public function get typicalItem():Object
    public function set typicalItem(value:Object):void

variableRowHeight

property 
variableRowHeight:Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If true, each row's height is the maximum of preferred heights of the cells displayed so far.

If false, the height of each row is just the value of the rowHeight property. If rowHeight isn't specified, then the height of each row is defined by the typicalItem property.

The default value is false.

This property can be used as the source for data binding. When this property is modified, it dispatches the variableRowHeightChanged event.



Implementation
    public function get variableRowHeight():Boolean
    public function set variableRowHeight(value:Boolean):void
Constructor Detail

DataGrid

()Constructor
public function DataGrid()

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Constructor.

Method Detail

addSelectedCell

()method
public function addSelectedCell(rowIndex:int, columnIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, adds the cell to the selection and sets the caret position to the cell. For all other selection modes, this method has no effect.

The rowIndex is the index in the data provider of the item containing the selected cell. The columnIndex is the index in columns of the column containing the selected cell.

Parameters

rowIndex:int — The 0-based row index of the cell.
 
columnIndex:int — The 0-based column index of the cell.

Returns
Booleantrue if no errors. false if rowIndex or columnIndex is invalid, or the selectionMode is invalid.

addSelectedIndex

()method 
public function addSelectedIndex(rowIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.MULTIPLE_ROWS, adds this row to the selection and sets the caret position to this row. For all other selection modes, this method has no effect.

The rowIndex is the index in the data provider of the item containing the selected cell.

Parameters

rowIndex:int — The 0-based row index of the cell.

Returns
Booleantrue if no errors. false if index is invalid or the selectionMode is invalid.

clearSelection

()method 
public function clearSelection():Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Removes all of the selected rows and cells, if selectionMode is not GridSelectionMode.NONE. Removes the caret and sets the anchor to the initial item.

Returns
Booleantrue if the selection changed. false if there was nothing previously selected.

commitCaretPosition

()method 
protected function commitCaretPosition(newCaretRowIndex:int, newCaretColumnIndex:int):void

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Updates the grid's caret position. If the caret position changes, the grid skin part dispatches a caretChange event.

Parameters

newCaretRowIndex:int — The 0-based rowIndex of the new caret position.
 
newCaretColumnIndex:int — The 0-based columnIndex of the new caret position. If the selectionMode is row-based, this is -1.

Related API Elements

commitInteractiveSelection

()method 
protected function commitInteractiveSelection(selectionEventKind:String, rowIndex:int, columnIndex:int, rowCount:int = 1, columnCount:int = 1):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

In response to user input (mouse or keyboard) which changes the selection, this method dispatches the selectionChanging event. If the event is not canceled, it then commits the selection change, and then dispatches the selectionChange event. The caret location is not updated. To detect if the caret has changed, use the caretChanged event.

Parameters

selectionEventKind:String — A constant defined by the GridSelectionEventKind class that specifies the selection that is being committed. If not null, this is used to generate the selectionChanging event.
 
rowIndex:int — If selectionEventKind is for a row or a cell, the 0-based rowIndex of the selection in the data provider. If selectionEventKind is for multiple cells, the 0-based rowIndex of the origin of the cell region. The default is -1 to indicate this parameter is not being used.
 
columnIndex:int — If selectionEventKind is for a single row or a single cell, the 0-based columnIndex of the selection. If selectionEventKind is for multiple cells, the 0-based columnIndex of the origin of the cell region. The default is -1 to indicate this parameter is not being used.
 
rowCount:int (default = 1) — If selectionEventKind is for a cell region, the number of rows in the cell region. The default is -1 to indicate this parameter is not being used.
 
columnCount:int (default = 1) — If selectionEventKind is for a cell region, the number of columns in the cell region. The default is -1 to indicate this parameter is not being used.

Returns
Booleantrue if the selection was committed or did not change, or false if the selection was canceled or could not be committed due to an error, such as index out of range or the selectionEventKind is not compatible with the selectionMode.

Related API Elements

endItemEditorSession

()method 
public function endItemEditorSession(cancel:Boolean = false):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Closes the currently active editor and optionally saves the editor's value by calling the item editor's save() method. If the cancel parameter is true, then the editor's cancel() method is called instead.

Parameters

cancel:Boolean (default = false) — If false, the data in the editor is saved. Otherwise the data in the editor is discarded.

Returns
Booleantrue if the editor session was saved, and false if the save was cancelled.

ensureCellIsVisible

()method 
public function ensureCellIsVisible(rowIndex:int, columnIndex:int = -1):void

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If necessary, set the verticalScrollPosition and horizontalScrollPosition properties so that the specified cell is completely visible. If rowIndex is -1 and columnIndex is specified, then just adjust the horizontalScrollPosition so that the specified column is visible. If columnIndex is -1 and rowIndex is specified, then just adjust the verticalScrollPosition so that the specified row is visible.

Parameters

rowIndex:int — The 0-based row index of the item renderer's cell, or -1 to specify a column.
 
columnIndex:int (default = -1) — The 0-based column index of the item renderer's cell, or -1 to specify a row.

invalidateCell

()method 
public function invalidateCell(rowIndex:int, columnIndex:int):void

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If the specified cell is visible, it is redisplayed. If variableRowHeight=true, then doing so may cause the height of the corresponding row to change.

If columnIndex is -1, then the entire row is invalidated. Similarly if rowIndex is -1, then the entire column is invalidated.

This method should be called when there is a change to any aspect of the data provider item at rowIndex that might have some impact on the way the specified cell is displayed. Calling this method is similar to calling the dataProvider.itemUpdated() method, which advises the Grid that all rows displaying the specified item should be redisplayed. Using this method can be relatively efficient, since it narrows the scope of the change to a single cell.

Parameters

rowIndex:int — The 0-based row index of the cell that changed, or -1.
 
columnIndex:int — The 0-based column index of the cell that changed or -1.

invalidateTypicalItem

()method 
public function invalidateTypicalItem():void

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 1.5

removeSelectedCell

()method 
public function removeSelectedCell(rowIndex:int, columnIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, removes the cell from the selection and sets the caret position to the cell. For all other selection modes, this method has no effect.

The rowIndex is the index in the data provider of the item containing the selected cell. The columnIndex is the index in columns of the column containing the selected cell.

Parameters

rowIndex:int — The 0-based row index of the cell.
 
columnIndex:int — The 0-based column index of the cell.

Returns
Booleantrue if no errors. false if rowIndex or columnIndex is invalid or the selectionMode is invalid.

removeSelectedIndex

()method 
public function removeSelectedIndex(rowIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, removes this row from the selection and sets the caret position to this row. For all other selection modes, this method has no effect.

The rowIndex is the index in the data provider of the item containing the selected cell.

Parameters

rowIndex:int — The 0-based row index of the cell.

Returns
Booleantrue if no errors. false if index is invalid or the selectionMode is invalid.

selectAll

()method 
public function selectAll():Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.MULTIPLE_ROWS, selects all rows and removes the caret or if selectionMode is GridSelectionMode.MULTIPLE_CELLS selects all cells and removes the caret. For all other selection modes, this method has no effect.

If items are added to the dataProvider or columns are added after this method is called, the new rows or cells in the new column will be selected.

This implicit "selectAll" mode ends when any of the following occur:

  • selection is cleared using clearSelection
  • selection reset using one of setSelectedCell, setSelectedCells, setSelectedIndex, selectIndices
  • dataProvider is refreshed and preserveSelection is false
  • dataProvider is reset
  • columns is refreshed, preserveSelection is false and selectionMode is GridSelectionMode.MULTIPLE_CELLS
  • columns is reset and selectionMode is GridSelectionMode.MULTIPLE_CELLS

Returns
Booleantrue if the selection changed.

selectCellRegion

()method 
public function selectCellRegion(rowIndex:int, columnIndex:int, rowCount:uint, columnCount:uint):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.MULTIPLE_CELLS, sets the selection to all the cells in the cell region and the caret position to the last cell in the cell region. For all other selection modes, this method has no effect.

The rowIndex is the index in the data provider of the item containing the origin of the cell region. The columnIndex is the index in columns of the column containing the origin of the cell region.

This method has no effect if the cell region is not wholly contained within the grid.

Parameters

rowIndex:int — The 0-based row index of the origin of the cell region.
 
columnIndex:int — The 0-based column index of the origin of the cell region.
 
rowCount:uint — Number of rows, starting at rowIndex to include in the cell region.
 
columnCount:uint — Number of columns, starting at columnIndex to include in the cell region.

Returns
Booleantrue if no errors. false if the cell region is invalid or the selectionMode is invalid.

selectIndices

()method 
public function selectIndices(rowIndex:int, rowCount:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.MULTIPLE_ROWS, sets the selection to the specfied rows and the caret position to endRowIndex. For all other selection modes, this method has no effect.

Each index represents an item in the data provider to include in the selection.

Parameters

rowIndex:int — 0-based row index of the first row in the selection.
 
rowCount:int — Number of rows in the selection.

Returns
Booleantrue if no errors. false if any of the indices are invalid, if startRowIndex is not less than or equal to endRowIndex, or the selectionMode is invalid.

selectionContainsCell

()method 
public function selectionContainsCell(rowIndex:int, columnIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, returns true if the cell is in the current selection.

The rowIndex must be between 0 and the length of the data provider. The columnIndex must be between 0 and the length of columns.

Parameters

rowIndex:int — The 0-based row index of the cell.
 
columnIndex:int — The 0-based column index of the cell.

Returns
Booleantrue if the current selection contains the cell.

selectionContainsCellRegion

()method 
public function selectionContainsCellRegion(rowIndex:int, columnIndex:int, rowCount:int, columnCount:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.MULTIPLE_CELLS, returns true if the cells in the cell region are in the current selection.

The rowIndex must be between 0 and the length of the data provider. The columnIndex must be between 0 and the length of columns.

Parameters

rowIndex:int — The 0-based row index of the cell.
 
columnIndex:int — The 0-based column index of the cell.
 
rowCount:int — Number of rows, starting at rowIndex to include in the cell region.
 
columnCount:int — Number of columns, starting at columnIndex to include in the cell region.

Returns
Booleantrue if the current selection contains all the cells in the cell region.

selectionContainsIndex

()method 
public function selectionContainsIndex(rowIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, returns true if the row at index is in the current selection.

The rowIndex is the index in the data provider of the item containing the selected cell.

Parameters

rowIndex:int — The 0-based row index of the row.

Returns
Booleantrue if the selection contains the row.

selectionContainsIndices

()method 
public function selectionContainsIndices(rowIndices:Vector.<int>):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.MULTIPLE_ROWS, returns true if the rows in indices are in the current selection.

Parameters

rowIndices:Vector.<int> — Vector of 0-based row indices to include in selection.

Returns
Booleantrue if the current selection contains these rows.

setSelectedCell

()method 
public function setSelectedCell(rowIndex:int, columnIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_CELL or GridSelectionMode.MULTIPLE_CELLS, sets the selection and the caret position to this cell. For all other selection modes, this method has no effect.

The rowIndex is the index in the data provider of the item containing the selected cell. The columnIndex is the index in columns of the column containing the selected cell.

Parameters

rowIndex:int — The 0-based row index of the cell.
 
columnIndex:int — The 0-based column index of the cell.

Returns
Booleantrue if if no errors. false if rowIndex or columnIndex is invalid or the selectionMode is invalid.

setSelectedIndex

()method 
public function setSelectedIndex(rowIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

If selectionMode is GridSelectionMode.SINGLE_ROW or GridSelectionMode.MULTIPLE_ROWS, sets the selection and the caret position to this row. For all other selection modes, this method has no effect.

The rowIndex is the index in the data provider of the item containing the selected cell.

Parameters

rowIndex:int — The 0-based row index of the cell.

Returns
Booleantrue if if no errors. false if index is invalid, or the selectionMode is invalid.

sortByColumns

()method 
public function sortByColumns(columnIndices:Vector.<int>, isInteractive:Boolean = false):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Sort the DataGrid by one or more columns, and refresh the display.

If the dataProvider is an ICollectionView, then it's sort property is set to a value based on each column's dataField, sortCompareFunction, and sortDescending flag. Then, the data provider's refresh() method is called.

If the dataProvider is not an ICollectionView, then this method has no effect.

Parameters

columnIndices:Vector.<int> — The indices of the columns by which to sort the dataProvider.
 
isInteractive:Boolean (default = false) — If true, GridSortEvent.SORT_CHANGING and GridSortEvent.SORT_CHANGE events are dispatched and the column header group visibleSortIndicatorIndices is updated with columnIndices if the GridSortEvent.SORT_CHANGING event is not cancelled.

Returns
Booleantrue if the dataProvider was sorted with the provided column indicies.

Related API Elements

startItemEditorSession

()method 
public function startItemEditorSession(rowIndex:int, columnIndex:int):Boolean

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Starts an editor session on a selected cell in the grid. This method by-passes checks of the editable property on the DataGrid and GridColumn that prevent the user interface from starting an editor session. A startItemEditorSession event is dispatched before an item editor is created. This allows a listener dynamically change the item editor for a specified cell. The event can also be cancelled by calling the preventDefault() method, to prevent the editor session from being created.

Parameters

rowIndex:int — The zero-based row index of the cell to edit.
 
columnIndex:int — The zero-based column index of the cell to edit.

Returns
Booleantrue if the editor session was started. Returns false if the editor session was cancelled or was otherwise unable to be started. Note that an editor session cannot be started in a column that is not visible.
Event Detail

caretChange

Event
Event Object Type: spark.events.GridCaretEvent
property GridCaretEvent.type = spark.events.GridCaretEvent.CARET_CHANGE

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part when the caret position, size, or visibility has changed due to user interaction or being programmatically set.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The GridSelectionEvent.CARET_CHANGE constant defines the value of the type property of the event object for a caretChange event, which indicates that the current caret position has just been changed.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
newColumnIndexThe zero-based column index of the caret position after it was changed. It is -1 if the selectionMode is row-based.
newRowIndexThe zero-based row index of the caret position after it was changed.
oldColumnIndexThe zero-based column index of the caret position before it was changed. It is -1 if the selectionMode is row-based.
oldRowIndexThe zero-based row index of the caret position before it was changed.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdCaretEvent.CARET_CHANGE

gridClick

Event  
Event Object Type: spark.events.GridEvent
property GridEvent.type = spark.events.GridEvent.GRID_CLICK

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part when the mouse is clicked over a cell.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The value of the type property for a gridClick GridEvent.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnThe column where the event occurred, or null if the event did not occur over a column.
columnIndexThe index of the column where the event occurred, or -1 if the event did not occur over a grid column.
gridThe Grid associated with this event.
itemThe data provider item for this row, or null if the event did not occur over a grid row.
itemRendererThe The item renderer that displayed this cell, or null if the event did not occur over a visible cell.
rowIndexThe index of the row where the event occurred, or -1 if the event did not occur over a grid row.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdEvent.GRID_CLICK

gridDoubleClick

Event  
Event Object Type: spark.events.GridEvent
property GridEvent.type = spark.events.GridEvent.GRID_DOUBLE_CLICK

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part when the mouse is double-clicked over a cell.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The value of the type property for a gridDoubleClick GridEvent.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnThe column where the event occurred, or null if the event did not occur over a column.
columnIndexThe index of the column where the event occurred, or -1 if the event did not occur over a grid column.
gridThe Grid associated with this event.
itemThe data provider item for this row, or null if the event did not occur over a grid row.
itemRendererThe The item renderer that displayed this cell, or null if the event did not occur over a visible cell.
rowIndexThe index of the row where the event occurred, or -1 if the event did not occur over a grid row.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdEvent.GRID_DOUBLE_CLICK

gridItemEditorSessionCancel

Event  
Event Object Type: spark.events.GridItemEditorEvent
property GridItemEditorEvent.type = spark.events.GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_CANCEL

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched after the item editor has been closed without saving its data.

The GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_CANCEL constant defines the value of the type property of the event object for a cancelridItemEditor event. Dispatched after the item editor has been closed without saving its data.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnIndexThe zero-based column index of the item that was edited but not modified.
rowIndexThe zero-based row index of the item that was edited but not modified.
columnThe column of the cell that was edited.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
type GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_CANCEL

Related API Elements

spark.components.DataGrid.itemEditorInstance

gridItemEditorSessionSave

Event  
Event Object Type: spark.events.GridItemEditorEvent
property GridItemEditorEvent.type = spark.events.GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_SAVE

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched after the data in item editor has been saved into the data provider and the editor has been closed.

The GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_SAVE constant defines the value of the type property of the event object for a saveGridItemEditor event. Dispatched after the data in item editor has been saved into the data provider and the editor has been closed.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnIndexThe zero-based column index of the item that was modified.
rowIndexThe zero-based row index of the item that was modified.
columnThe column of the cell that was edited.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
type GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_SAVE

Related API Elements

spark.components.DataGrid.itemEditorInstance

gridItemEditorSessionStart

Event  
Event Object Type: spark.events.GridItemEditorEvent
property GridItemEditorEvent.type = spark.events.GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_START

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched immediately after an item editor has been opened.

The GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_START constant defines the value of the type property of the event object for a openGridItemEditor event. Dispatched immediately after an item editor has been opened.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnIndexThe zero-based column index of the item editor.
rowIndexThe zero-based row index of the item editor.
columnThe column of the cell that is being edited.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
type GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_START

Related API Elements

spark.components.DataGrid.itemEditorInstance

gridItemEditorSessionStarting

Event  
Event Object Type: spark.events.GridItemEditorEvent
property GridItemEditorEvent.type = spark.events.GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched when a new item editor session has been requested. A listener can dynamically determine if a cell is editable and cancel the edit (by calling the preventDefault() method) if it is not. A listener may also dynamically change the editor used by assigning a different item editor to a column.

If this event is canceled the item editor will not be created.

The GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING constant defines the value of the type property of the event object for a startGridItemEditorSession event. Dispatched when a new item editor session has been requested. A listener can dynamically determine if a cell is editable and cancel the edit by calling the preventDefault() method if it is not. A listener can also dynamically change the editor used by assigning a different item editor to a grid column.

If this event is canceled the item editor will not be created.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelabletrue
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnIndexThe zero-based column index of the requested item editor.
rowIndexThe zero-based row index of the requested item editor.
columnThe column of the cell associated with the edit request.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
type GridItemEditorEvent.GRID_ITEM_EDITOR_SESSION_STARTING

Related API Elements

spark.components.DataGrid.itemEditorInstance
flash.events.Event

gridMouseDown

Event  
Event Object Type: spark.events.GridEvent
property GridEvent.type = spark.events.GridEvent.GRID_MOUSE_DOWN

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part when the mouse button is pressed over a grid cell.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The value of the type property for a gridMouseDown GridEvent.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnThe column where the event occurred, or null if the event did not occur over a column.
columnIndexThe index of the column where the event occurred, or -1 if the event did not occur over a grid column.
gridThe Grid associated with this event.
itemThe data provider item for this row, or null if the event did not occur over a grid row.
itemRendererThe The item renderer that displayed this cell, or null if the event did not occur over a visible cell.
rowIndexThe index of the row where the event occurred, or -1 if the event did not occur over a grid row.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdEvent.GRID_MOUSE_DOWN

gridMouseDrag

Event  
Event Object Type: spark.events.GridEvent
property GridEvent.type = spark.events.GridEvent.GRID_MOUSE_DRAG

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part after a gridMouseDown event if the mouse moves before the button is released.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The value of the type property for a gridMouseDrag GridEvent. This event is only dispatched when a listener has handled a mouseDown event, and then only while the mouse moves with the button held down.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnThe column where the event occurred, or null if the event did not occur over a column.
columnIndexThe index of the column where the event occurred, or -1 if the event did not occur over a grid column.
gridThe Grid associated with this event.
itemThe data provider item for this row, or null if the event did not occur over a grid row.
itemRendererThe The item renderer that displayed this cell, or null if the event did not occur over a visible cell.
rowIndexThe index of the row where the event occurred, or -1 if the event did not occur over a grid row.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdEvent.GRID_MOUSE_DRAG

gridMouseUp

Event  
Event Object Type: spark.events.GridEvent
property GridEvent.type = spark.events.GridEvent.GRID_MOUSE_UP

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part after a gridMouseDown event when the mouse button is released, even if the mouse is no longer within the grid.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The value of the type property for a gridMouseUp GridEvent.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnThe column where the event occurred, or null if the event did not occur over a column.
columnIndexThe index of the column where the event occurred, or -1 if the event did not occur over a grid column.
gridThe Grid associated with this event.
itemThe data provider item for this row, or null if the event did not occur over a grid row.
itemRendererThe The item renderer that displayed this cell, or null if the event did not occur over a visible cell.
rowIndexThe index of the row where the event occurred, or -1 if the event did not occur over a grid row.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdEvent.GRID_MOUSE_UP

gridRollOut

Event  
Event Object Type: spark.events.GridEvent
property GridEvent.type = spark.events.GridEvent.GRID_ROLL_OUT

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part when the mouse leaves a grid cell.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The value of the type property for a gridRollOut GridEvent.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnThe column where the event occurred, or null if the event did not occur over a column.
columnIndexThe index of the column where the event occurred, or -1 if the event did not occur over a grid column.
gridThe Grid associated with this event.
itemThe data provider item for this row, or null if the event did not occur over a grid row.
itemRendererThe The item renderer that displayed this cell, or null if the event did not occur over a visible cell.
rowIndexThe index of the row where the event occurred, or -1 if the event did not occur over a grid row.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdEvent.GRID_ROLL_OUT

gridRollOver

Event  
Event Object Type: spark.events.GridEvent
property GridEvent.type = spark.events.GridEvent.GRID_ROLL_OVER

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched by the grid skin part when the mouse enters a grid cell.

To handle this event, assign an event handler to the grid skin part of the DataGrid control.

The value of the type property for a gridRollOver GridEvent.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
columnThe column where the event occurred, or null if the event did not occur over a column.
columnIndexThe index of the column where the event occurred, or -1 if the event did not occur over a grid column.
gridThe Grid associated with this event.
itemThe data provider item for this row, or null if the event did not occur over a grid row.
itemRendererThe The item renderer that displayed this cell, or null if the event did not occur over a visible cell.
rowIndexThe index of the row where the event occurred, or -1 if the event did not occur over a grid row.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGirdEvent.GRID_ROLL_OVER

selectionChange

Event  
Event Object Type: spark.events.GridSelectionEvent
property GridSelectionEvent.type = spark.events.GridSelectionEvent.SELECTION_CHANGE

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched when the selection has changed.

This event is dispatched when the user interacts with the control. When you change the selection programmatically, the component does not dispatch the selectionChange event. In either case it dispatches the valueCommit event as well.

The GridSelectionEvent.SELECTION_CHANGE constant defines the value of the type property of the event object for a selectionChange event, which indicates that the current selection has just been changed.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the selectionChange event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
kindThe kind of changing event. The valid values are defined in GridSelectionEventKind class as constants. This value determines which properties in the event are used.
selectionChangeThe just completed selection change that was triggered by a user gesture. Use the DataGrid selection methods to determine the current selection.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGridSelectionEvent.SELECTION_CHANGE

selectionChanging

Event  
Event Object Type: spark.events.GridSelectionEvent
property GridSelectionEvent.type = spark.events.GridSelectionEvent.SELECTION_CHANGING

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched when the selection is going to change. Calling the preventDefault() method on the event prevents the selection from changing.

This event is dispatched when the user interacts with the control. When you change the selection programmatically, the component does not dispatch the selectionChanging event.

The GridSelectionEvent.SELECTION_CHANGING constant defines the value of the type property of the event object for a selectionChanging event, which indicates that the current selection is about to change. Call preventDefault() on this event to prevent the selection from changing.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the selectionChanging event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myButton.addEventListener() to register an event listener, myButton is the value of the currentTarget.
kindThe kind of changing event. The valid values are defined in GridSelectionEventKind class as constants. This value determines which properties in the event are used.
selectionChangeThe upcoming selection change that is triggered by a user gesture.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGridSelectionEvent.SELECTION_CHANGING

sortChange

Event  
Event Object Type: spark.events.GridSortEvent
property GridSortEvent.type = spark.events.GridSortEvent.SORT_CHANGE

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched after the sort has been applied to the data provider's collection. Typically this is after the user releases the mouse button on a column header and the sort has been applied to the data provider's collection.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the sortChanging event.

The GridSortEvent.SORT_CHANGE constant defines the value of the type property of the event object for a sortChange event, which indicates that a sort filter has just been applied to the grid's dataProvider collection.

Typically, if a column header mouse click triggered the sort, then the last index of columnIndices is the column's index. Note that interactive sorts are not necessarily triggered by a mouse click.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the sortChange event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
columnIndicesThe vector of column indices of the sorted columns.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myDataGrid.addEventListener() to register an event listener, myDataGrid is the value of the currentTarget.
newSortFieldsThe array of ISortFields for this sort.
oldSortFieldsThe array of ISortFields for the last sort.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGridSelectionEvent.SORT_CHANGE

sortChanging

Event  
Event Object Type: spark.events.GridSortEvent
property GridSortEvent.type = spark.events.GridSortEvent.SORT_CHANGING

Language Version: ActionScript 3.0
Product Version: Flex 4.5
Runtime Versions: Flash Player 10, AIR 2.5

Dispatched before the sort has been applied to the data provider's collection. Typically this is when the user releases the mouse button on a column header to request the control to sort the grid contents based on the contents of the column. Only dispatched if the column is sortable and the data provider supports sorting.

The DataGrid control has a default handler for this event that implements a single-column sort and updates the visibleSortIndices in the grid's columnHeaderGroup with the columnIndices.

Multiple-column sort can be implemented by calling the preventDefault() method to prevent the single column sort and setting the columnIndices and newSortFields parameters of the event to change the default behavior. newSortFields should be set to the desired sort fields. columnIndices should be set to the indices of the columns that should have a visible sort indicator in the column header bar.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the sortChanging event.

The GridSortEvent.SORT_CHANGING constant defines the value of the type property of the event object for a sortChanging event, which indicates that a sort filter is about to be applied to the grid's dataProvider collection. Call preventDefault() on this event to prevent the sort from occurring or you modify columnIndices and newSortFields if you want to change the default behavior of the sort.

Typically, if a column header mouse click triggered the sort, then the last index of columnIndices is the column's index. Note that interactive sorts are not necessarily triggered by a mouse click.

This event is dispatched when the user interacts with the control. When you sort the data provider's collection programmatically, the component does not dispatch the sortChanging event.

The properties of the event object have the following values:

PropertyValue
bubblesfalse
cancelablefalse
columnIndicesThe vector of column indices of the columns to be sorted.
currentTargetThe Object that defines the event listener that handles the event. For example, if you use myDataGrid.addEventListener() to register an event listener, myDataGrid is the value of the currentTarget.
newSortFieldsThe array of ISortFields for this sort.
oldSortFieldsThe array of ISortFields for the last sort.
targetThe Object that dispatched the event; it is not always the Object listening for the event. Use the currentTarget property to always access the Object listening for the event.
typeGridSelectionEvent.SORT_CHANGING
DataGridSimpleExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--
A very simple DataGrid example.   

The ArrayCollection is the list of dataProvider items, one per DataGrid row and the DataGrid
automatically creates one column for each property in the first item.   The dataProvider
property tag isn't specified because it's the default property and leaving it out makes the code
just a little simpler looking.  Although any class that implements IList can be used an a 
dataProvder, ArrayCollection is convenient because it enables the column sorting support.

We've used the s:DataItem class to create data items for this example although in this case
fx:Object would have worked equally well, because the example doesn't rely on data item 
property bindings.  DataItem is used to define an untyped Object whose properties are bindable. 

-->

<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark">
    
    <s:Panel title="Spark DataGrid Control Example of a very simple DataGrid"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        <s:DataGrid id="dataGrid" requestedRowCount="5" verticalCenter="0" horizontalCenter="0">
            <s:ArrayCollection>
                <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
                <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
                <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
                <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
                <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
                <s:DataItem key="1005" name="File" price="150.05" call="true"/>
                <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
                <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
                <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
                <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>             
            </s:ArrayCollection>
        </s:DataGrid>
    </s:Panel>
</s:Application>
DataGridMasterDetailExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--
A simple combination of Spark DataGrid and Form that demonstrates using the DataGrid 
selectedItem property to connect "master" and "detail" views.

The value of the DataGrid's selectedItem property is the dataProvider item that's 
currently selected.  This example displays a Datagrid and a Form, and the Form
displays various aspects of the selectedItem.  Elements of the Form bind to the 
DataGrid's selectedItem, so when the selection changes the form is updated
automatically.  In a configuration like this, the DataGrid is the "master" view
and the Form is the "detail" view.

The selectedItem bindings are not valid unless there's a non-null selection, so
we've specified requireSelection="true" for the DataGrid.  Note also that we've 
used a CurrencyFormatter to convert Numbers that represent prices, to nicely formatted
and localized strings.

-->

<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark">
    
    <fx:Declarations>
        <s:CurrencyFormatter id="cf" useCurrencySymbol="true"/>
    </fx:Declarations>    
    
    <s:Panel title='Spark DataGrid Control Example demonstrates the use of selectedItem to connect "master" and "detail" views'
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        
        <s:VGroup horizontalAlign="justify" left="5" right="5" top="5" bottom="5">
            <s:DataGrid id="dataGrid" requestedRowCount="4" requireSelection="true">
                <s:columns>
                    <s:ArrayList>
                        <s:GridColumn dataField="name" headerText="Name"/>
                        <s:GridColumn dataField="price" headerText="Price"/>
                    </s:ArrayList>
                </s:columns>
                
                <s:ArrayCollection>
                    <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
                    <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
                    <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
                    <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
                    <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
                    <s:DataItem key="1005" name="File" price="150.05" call="true"/>
                    <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
                    <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
                    <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
                    <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>             
                </s:ArrayCollection>
            </s:DataGrid>
            
            <s:Scroller height="100%">
                <s:Group>
                    <s:Form width="100%" height="100%">
                        <s:FormHeading label="Selected Product Detail" textAlign="center"/>            
                        <s:FormItem label="Product Key:">
                            <s:Label text="{dataGrid.selectedItem.key}"/>
                        </s:FormItem>
                        <s:FormItem label="Product Name:">
                            <s:Label text="{dataGrid.selectedItem.name}"/>
                        </s:FormItem>
                        <s:FormItem label="Product Price:">
                            <s:HGroup verticalAlign="baseline">
                                <s:Label text="{cf.format(dataGrid.selectedItem.price)}"/>
                                <s:Label text="Tax: {cf.format(dataGrid.selectedItem.price * 0.0975)}"/>
                                <s:Label text="Total: {cf.format(dataGrid.selectedItem.price * 1.0975)}"/>
                            </s:HGroup>
                        </s:FormItem>              
                        <s:FormItem label="Followup Needed:" >
                            <s:HGroup verticalAlign="baseline">
                                <s:Label text="{(dataGrid.selectedItem.call) ? 'Yes' : 'No'}"/>
                                <s:Button label="Call Now"
                                          enabled="{dataGrid.selectedItem.call}"
                                          click="dataGrid.selectedItem.call=false"/>
                            </s:HGroup>                              
                        </s:FormItem>            
                    </s:Form>
                </s:Group>
            </s:Scroller>
        </s:VGroup>
    </s:Panel>
</s:Application>
DataGridTypicalItemExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--
Demonstrate using the DataGrid typicalItem property to initialize column widths
and the invalidateTypicalItem() method to notify the DataGrid about typicalItem
property changes.

Use the input fields at the top of the application to change typicalItem properties.
Use tab to commit the typicalItem change.

The DataGrid's typicalItem is used to compute the initial width of each GridColumn that 
doesn't specify an explicit width.  When the DataGrid's width is unconstrained, then its 
overall width is essentially the sum of the column widths.  If the DataGrid's width is
constrained, for example if left and right are specified, then the typicalItem column widths
may be padded so that all of the available horizontal space is allocated.

The typicalItem is used the first time the DataGrid is measured and if a typicalItem wasn't
specified, then the first dataProvider item is used.  To compute column widths, a renderer is created
and validated, its preferred size is recorded, and then the renderer is discarded.
The advantage of basing column widths on the typicalItem, instead of specifying explicit GridColumn
widths, is that doing so incoporates hard to predict factors like font sizes and styles, or 
localized text values.

Because typical item column widths are cached, it's necessary to notify the DataGrid when the 
typicalItem has changed. This is done by calling the DataGrid invalidateTpyicalItem() method.
In this example each input field calls invalidateTypicalItem() when a typicalItem property is changed.

-->

<s:Application applicationComplete="items.addItemAt(dataGrid.typicalItem, 0)"
               xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark">
    
    <s:Panel title="Spark DataGrid Control Example that demonstrates using the typicalItem property to size the DataGrid"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        
        <s:controlBarContent>
            <s:VGroup gap="5">
                <s:Label text="Typical Item:" fontWeight="bold" />
                <s:HGroup verticalAlign="baseline">
                    <s:Label text="key:"  textAlign="right" width="40"/>
                    <s:TextInput text="@{dataGrid.typicalItem.key}" change="dataGrid.invalidateTypicalItem()"/>
                </s:HGroup>
                <s:HGroup verticalAlign="baseline">        
                    <s:Label text="name:"  textAlign="right" width="40"/>
                    <s:TextInput text="@{dataGrid.typicalItem.name}" change="dataGrid.invalidateTypicalItem()"/>
                </s:HGroup>
                <s:HGroup verticalAlign="baseline">        
                    <s:Label text="price:" textAlign="right" width="40"/>
                    <s:TextInput text="@{dataGrid.typicalItem.price}" change="dataGrid.invalidateTypicalItem()"/>
                </s:HGroup>
                <s:HGroup verticalAlign="baseline">        
                    <s:Label text="call:" textAlign="right" width="40"/>
                    <s:TextInput text="@{dataGrid.typicalItem.call}" change="dataGrid.invalidateTypicalItem()"/>
                </s:HGroup>        
            </s:VGroup>
        </s:controlBarContent>
        
        <s:DataGrid id="dataGrid" left="5" right="5" top="5" bottom="5"
                    requestedRowCount="5">
            <!--
            The typicalItem defines the width of each column.  We also insert it at rowIndex=0
            (see applicationComplete above) to help visualize the impact of typicalItem changes.
            Usually the typicalItem is not displayed.
            -->
            <s:typicalItem>
                <s:DataItem key="99999" name="Typical Item" price="123.45" call="false"/>
            </s:typicalItem>
            
            <s:ArrayCollection id="items">
                <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
                <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
                <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
                <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
                <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
                <s:DataItem key="1005" name="File" price="150.05" call="true"/>
                <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
                <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
                <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
                <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>             
            </s:ArrayCollection>
        </s:DataGrid>
    </s:Panel>
</s:Application>
DataGridRowHeightExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--
Demonstrate the DataGrid variableRowHeight and rowHeight properties. 

When variableRowHeight="false" (the default) use the slider to change the row height 
of all the DataGrid's rows. When variableRowHeight="true", each row's height is computed.  
With the variableRowHeight checkbox checked, try adding enough text to a string in the 
"name" column to cause the renderer to wrap, or resize the column's width by dragging 
the header's column separators.


By default all of the rows in a DataGrid have the same height.  The rows' heights are
defined by the rowHeight property and if its value is not specified, the computed "preferred" 
height of the first row is used.   If the variableRowHeight property is set to true,
then the height of each row is the maximum measured height of each cell that's been exposed,
so far.  That means that when the DataGrid's columns aren't all visible and variableRowHeight="true", 
scrolling new columns into view can cause a row's height to grow.   Similarly, the DataGrid
uses the first row's height (or the rendered height of the "typicalItem", if it was specified)
as an estimate for the heights of rows that haven't been scrolled into view yet.   This means
that the DataGrid Grid's contentHeight, i.e. total height of all of the rows, can grow or even 
shrink as it's scrolled, when variableRowHeight=true.  Since the scrollbar's thumb size reflects
the content size, you may see its height change a little as you scroll, although as the number
of rows gets large, this effect usually isn't noticeable.

The runtime support for variable height rows requires quite a bit more bookkeeping than the 
variableRowHeight="false" case and there's a commensurate impact on performance and footprint.
That's why by default the DataGrid is configured for fixed height rows.   That said, item
renderer complexity tends have a much bigger impact on display/scrolling performance, so 
developers need not shy away from specifying variableRowHeight=true, even when optimizing for
performance.

-->

<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark">
    
    <s:Panel title="Spark DataGrid Control Example which demonstrates the variableRowHeight and rowHeight properties"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        
        <s:controlBarContent>
            <s:HGroup verticalAlign="baseline">
                <s:CheckBox label="variableRowHeight={dataGrid.variableRowHeight}" selected="@{dataGrid.variableRowHeight}"/>
                <s:Label text="      "/> <!-- blank space -->
                <s:HSlider minimum="12" maximum="120" value="@{dataGrid.grid.rowHeight}"/>
                <s:Label text="rowHeight={dataGrid.grid.rowHeight}"/>
            </s:HGroup>
        </s:controlBarContent>    
        
        <s:DataGrid id="dataGrid" left="5" right="5" top="5" bottom="5" editable="true">
            <s:ArrayCollection>
                <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
                <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
                <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
                <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
                <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
                <s:DataItem key="1005" name="File" price="150.05" call="true"/>
                <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
                <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
                <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
                <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>             
            </s:ArrayCollection>
        </s:DataGrid>
    </s:Panel>
</s:Application>
DataGridSelectionExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--
A DataGrid example that demonstrates the selectionChange and selectionChanging events, 
the "multipleCells" selection mode, a dataProvider that's a two dimensional array of 
numbers, and a column whose values are computed and can not be selected.

This application displays the min, max, and average value of the selected cells.  The DataGrid's
last column displays the computed min and max values for each row.   

DataGrid supports five selection modes including GridSelectionMode.MULTIPLE_CELLS ("multipleCells").
Specifying selectionMode="multipleCells" enables selection of individual cells with mouse click or 
control-click or rectangular groups of cells with shift-click.  Each time the user attempts to
change the selection the DataGrid dispatches a "selectionChanging" event and, if that event is
not cancelled with event.preventDefault(), a "selectionChange" and a "valueCommit" event. 

This application uses the changing event to cancel attempts to include the last column in the 
selection, because the last column isn't part of the dataProvider, it's just a summary of the 
row's values in term of the minumum and maximum.

To handle the special case where the user attempts to select all cells by typing
control-A, we cancel the selectionChanging event and then use  dataGrid.selectCellRegion()
to select all cells except those in the last column.  The valueCommit event is dispatched
when the selection changes for any reason, not just in response to user input, and so we
use that to update the selectionMinimum,Maximum,Average variables.

Each time the selection changes, the application's selectionChangeHandler() method updates
the three bindable variables that are dispayed in the control bar.  The DataGrid's 
selectedCells property contains the row,column indices of the selected cells as a 
Vector of CellPosition objects.

-->

<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark">
    
    <!--
        Defines three [Bindable] global variables
    -->
    <fx:Declarations>
        <fx:Number id="selectionMinimum"/>
        <fx:Number id="selectionMaximum"/>
        <fx:Number id="selectionAverage"/>        
    </fx:Declarations>
    
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            
            import spark.components.gridClasses.CellPosition;
            import spark.components.gridClasses.CellRegion;
            import spark.events.GridSelectionEvent;
            import spark.events.GridSelectionEventKind;
            
            // Create a dataProvider whose items are arrays of 6 random numbers.  The DataGrid's
            // item renderer will display item[columnIndex].
            
            private function initializeDataProvider():void
            {
                const nRows:int = 100;
                const nCols:int = 6;
                
                const dataArray:Array = new Array(nRows);
                for (var rowIndex:int = 0; rowIndex < dataArray.length; rowIndex++)
                {
                    var values:Array = new Array(nCols);
                    for (var columnIndex:int = 0; columnIndex < values.length; columnIndex++)
                        values[columnIndex] = Math.round(Math.random() * 1000);
                    dataArray[rowIndex] = values;
                }
                
                dataGrid.dataProvider = new ArrayCollection(dataArray);
                
                const typicalItem:Array = new Array(nCols);
                for (columnIndex = 0; columnIndex < typicalItem.length; columnIndex++)
                    typicalItem[columnIndex] = 99999;
                
                dataGrid.typicalItem = typicalItem;
            }
            
            // Return the dataProvider cell value displayed at rowIndex, columnIndex
            
            public function getCellValue(rowIndex:int, columnIndex:int):Number
            {
                return dataGrid.dataProvider.getItemAt(rowIndex)[columnIndex];
            }
            
            // Update the Bindable variables: selectionMin,Max,Average based on the selected cells
            
            private function selectionChangeHandler():void
            {
                const selectedCells:Vector.<CellPosition> = dataGrid.selectedCells;
                var min:Number = NaN;
                var max:Number = NaN;
                var sum:Number = 0;
                
                for each (var cell:CellPosition in selectedCells)
                {
                    var value:Number = getCellValue(cell.rowIndex, cell.columnIndex);
                    min = isNaN(min) ? value : Math.min(min, value);
                    max = isNaN(max) ? value : Math.max(max, value);
                    sum += value;
                }
                
                selectionMinimum = min;
                selectionMaximum = max;
                selectionAverage = (selectedCells.length > 0) ? Math.round((sum / selectedCells.length)) : NaN;
            }
            
            // Prevent the user from selecting the last column
            
            private function selectionChangingHandler(event:GridSelectionEvent):void
            {
                const lastColumnIndex:int = dataGrid.columns.length - 1;
                const selectionChange:CellRegion = event.selectionChange;
                const rightSelectionIndex:int = selectionChange.columnIndex + selectionChange.columnCount - 1;
                if (rightSelectionIndex == lastColumnIndex)
                {
                    event.preventDefault();
                    
                    // If the user was trying to select-All then do so after clipping the last column

                    if (event.kind == GridSelectionEventKind.SELECT_ALL)
                        dataGrid.selectCellRegion(0, 0, selectionChange.rowCount, selectionChange.columnCount - 1);
                }
                
                
            }
        ]]>
    </fx:Script>
    
    <!--
       The DataGrid's dataProvider and typicalItem are set at initialize time by the
       initializeDataProvider method.
    -->
    <s:Panel title="Spark DataGrid Control Example that demonstrates selection including a computed column which is not selectable"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        <!--
        To make the label look "disabled" when there's no selection, we set its alpha="0.5".
        -->
        <s:controlBarContent>
            <s:Label alpha="{(dataGrid.selectionLength > 0) ? 1.0 : 0.5}"
                     text="Selected Cells: minimum = {selectionMinimum}, maximum = {selectionMaximum}, average = {selectionAverage}"/>
        </s:controlBarContent>

        <s:DataGrid id="dataGrid" left="5" right="5" top="5" bottom="5"
                alternatingRowColors="[0xFFFFFF, 0xEDFFE9]"
                selectionMode="multipleCells"
                valueCommit="selectionChangeHandler()"
                selectionChanging="selectionChangingHandler(event)"
                initialize="initializeDataProvider()">
            
            <!-- 
                The default item renderer is used by the first 6 columns to display the dataProvider item's 
                array element value at columnIndex.
            -->
            <s:itemRenderer>
                <fx:Component>
                    <s:DefaultGridItemRenderer>
                        <fx:Script>
                            <![CDATA[
                                override public function prepare(hasBeenRecycled:Boolean):void
                                {
                                    label = data[columnIndex];
                                }
                            ]]>
                        </fx:Script>
                    </s:DefaultGridItemRenderer>
                </fx:Component>
            </s:itemRenderer>
            
            <s:columns>
                <s:ArrayList>
                    <!--
                        The first six columns inherit the DataGrid's itemRenderer.
                    -->
                    <s:GridColumn headerText="C0"/>
                    <s:GridColumn headerText="C1"/>    
                    <s:GridColumn headerText="C2"/>    
                    <s:GridColumn headerText="C3"/>
                    <s:GridColumn headerText="C4"/>
                    <s:GridColumn headerText="C5"/>
                    
                    <!--
                        The last column specifies its own item renderer that displays the min and max
                        values for the entire row.
                    -->
                    <s:GridColumn headerText="Row Min, Max">
                        <s:itemRenderer>
                            <fx:Component>
                                <s:DefaultGridItemRenderer fontStyle="italic" color="0x734669">
                                    <fx:Script>
                                        <![CDATA[
                                            override public function prepare(hasBeenRecycled:Boolean):void
                                            {
                                                var min:Number = Math.min.apply(null, data as Array);
                                                var max:Number = Math.max.apply(null, data as Array);
                                                label = min + ", " + max;
                                            }
                                        ]]>
                                    </fx:Script>
                                </s:DefaultGridItemRenderer>
                            </fx:Component>
                        </s:itemRenderer>                    
                    </s:GridColumn>                
                </s:ArrayList>
            </s:columns>
        </s:DataGrid>
    </s:Panel>        
</s:Application>
DataGridInvalidateCellExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--
This example demonstrates the use of the DataGrid invalidateCell() method.

Pressing the "Run" button starts a timer that updates DataGrid cells at the
rate specified with the slider.

This "Christmas Tree" DataGrid example displays a dataProvider with items whose 
substructure is constantly changing.  Each dataProvider item has one object
valued property per column, and each of those properties has an object value
that defines what's displayed in a single cell.  To keep things simple the
column properties are just called "C0", "C1", ... and the value of each property
is an object itself, with "color" and "index" properties, like {color:NN, index:NN}.
So the data for the cell at rowIndex=10, columnIndex=5:

    dataGrid.dataProvider.getItemAt(10)["C5"] =>  {color:0xFF6C0D, index:4}

The DataGrid has no way of knowing when the color,index data for a cell has been updated
so the developer must call invalidateCell(rowIndex, columnIndex) to let the DataGrid
know that the specified cell must be redisplayed.  When the "Run" button is toggled
on, updateTimerHandler() method  below is called up to 64 times/second and each
time it updates a single random cell's color and index properties and then calls 
invalidateCell().  Calling invalidateCell() only causes the (one) corresponding item
renderer to redisplay, so long as doing so doesn't invalidate the corresponding row's
height.  That can occur if variableRowHeight=true and if it does, the entire DataGrid
is redisplayed.

The CPU load produced by applications like this one is only proportional to the update rate 
and the renderers' complexity, so long as the overall grid layout isn't affected by 
the cell updates.  Using fixed height rows with variableRowHeight="false" (the default),
simple item renderers, and not dynamically changing column widths, are good ways to ensure 
that the CPU load is minimized.

-->

<s:Application  
    xmlns:fx="http://ns.adobe.com/mxml/2009"
    xmlns:s="library://ns.adobe.com/flex/spark">
    
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayList;
            
            import spark.components.gridClasses.GridColumn;
            
            // DatGrid size.  Roughly fills my laptop screen if the application window is maximized.
            private var columnCount:int = 16;
            private var rowCount:int = 16;
            
            // Colors from the "tropical breakfast" theme, http://kuler.adobe.com/#themeID/1194065
            private var colors:Array = [0x216273, 0x44996F, 0xE5C10F, 0xF29E00, 0xFF6C0D];
            
            [Bindable] private var updatesPerSecond:Number = 12;    // update "rate"
            private var updateTimer:Timer = null;
            
            // Initialize the DataGrid's columns, dataProvider and typicalItem.  We're creating
            // columnCount columns and rowCount rows (dataProvider items).   The value of each 
            // dataProvider item is an object with one property per column, called 
            // "C0", "C1", ...  The value of each of those "C<N>" properties is a {color:NN, index:NN} 
            // object that defines what's displayed in an individual cell.
            
            private function initializeDataGrid():void
            {
                const columnsArray:Array = new Array(columnCount);
                const typicalItem:Object = {};
                const dataArray:Array = new Array(rowCount);
                
                for (var columnIndex:int = 0; columnIndex < columnCount; columnIndex++)
                {
                    var columnProperty:String = "C" + columnIndex;
                    columnsArray[columnIndex] = new GridColumn(columnProperty);
                    typicalItem[columnProperty] = {color:0, index:0};
                }
                
                for(var rowIndex:int = 0; rowIndex < rowCount; rowIndex++)
                {
                    var item:Object = {};
                    for (columnIndex = 0; columnIndex < columnCount; columnIndex++)
                        item["C" + columnIndex] = {color:colors[0], index:0};
                    dataArray[rowIndex] = item;
                }
                
                dataGrid.columns = new ArrayList(columnsArray);
                dataGrid.typicalItem = typicalItem;
                dataGrid.dataProvider = new ArrayList(dataArray);
            }

            // Toggle the timer that changes the data and calls invalidateCell().
            // See updateTimerHandler().
            
            private function runTest():void
            {
                if (!updateTimer)
                {
                    updateTimer = new Timer(1000.0 / updatesPerSecond);
                    updateTimer.addEventListener(TimerEvent.TIMER, updateTimerHandler);
                }
                
                if (runToggleButton.selected)
                {
                    updateTimer.start();
                }
                else
                {
                    updateTimer.stop();
                    cellLocationLabel.text = "";
                }
            }
            
            private static function randomIndex(length:int):int
            {
                return Math.round(Math.random() * (length - 1));
            }
            
            // When the timer is running this method is called updatesPerSecond times per second.
            // It modifies the index and color properties for a single cell and then calls
            // invalidateCell() to let the DataGrid now that the cell needs to be redisplayed.
            // See initializeDataGrid() for more about how the data for each cell is defined.
            
            private function updateTimerHandler(event:TimerEvent):void
            {
                const rowIndex:int = randomIndex(rowCount);
                const columnIndex:int = randomIndex(columnCount);
                
                cellLocationLabel.text = "(" + rowIndex + ", " + columnIndex + ")";
                
                const item:Object = dataGrid.dataProvider.getItemAt(rowIndex);
                const columnProperty:String = "C" + columnIndex;
                
                const index:int = Math.min(item[columnProperty].index + 1, colors.length - 1);
                item[columnProperty].index = index;
                item[columnProperty].color = colors[index]; 
                
                dataGrid.invalidateCell(rowIndex, columnIndex);
            }
            
            private function changeUpdateRate():void
            {
                if (updateTimer)
                    updateTimer.delay = 1000.0 / updatesPerSecond;
            }
        ]]>
    </fx:Script>
    
    <s:Panel title="Spark DataGrid Control Example demonstrates the use of the DataGrid invalidateCell() method"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        
        <s:controlBarContent>
            <s:HGroup verticalAlign="baseline" width="100%">
                <s:ToggleButton id="runToggleButton" label="Run" change="runTest()"/>
                <s:HSlider id="updateRateSlider" minimum="1" maximum="64" value="@{updatesPerSecond}" snapInterval="1" changeEnd="changeUpdateRate()"/>
                <s:Label id="updateRateLabel" text="{updateRateSlider.value} updates/second" />
                <s:Label id="cellLocationLabel" width="100%" textAlign="right"/>
            </s:HGroup>
        </s:controlBarContent>
        
        <s:DataGrid id="dataGrid" left="5" right="5" top="5" bottom="5" initialize="initializeDataGrid()">
            <!--
                We're using one item renderer for *all* columns, so the renderer is responsible for 
                looking up the dataProvider item's column specific value.
            -->
            <s:itemRenderer>
                <fx:Component>
                    <s:GridItemRenderer>
                        <fx:Script>
                            <![CDATA[                                
                                // Each dataProvider item has one {color:NN, index:NN} object valued
                                // property whose name is the same as the column's dataField.  For
                                // example the first column's dataField is "C0" and so this.data["C0"]
                                // is the renderer's color,index object.   We use the color and index
                                // properties to initialize the renderer here.
                                
                                override public function prepare(hasBeenRecycled:Boolean):void
                                {
                                    colorDisplay.color = data[column.dataField].color;
                                    indexDisplay.text = String(data[column.dataField].index);
                                }
                            ]]>
                        </fx:Script>
                        <!-- black item renderer background with alpha=0.75 to expose the 
                             selection/hover indicators -->
                        <s:Rect left="0" right="0" top="0" bottom="0">
                            <s:fill>
                                <s:SolidColor alpha="0.75" color="0x000000"/>
                            </s:fill>                        
                        </s:Rect>
                        
                        <!-- single digit text, displays index property -->
                        <s:Label id="indexDisplay" left="45" verticalCenter="0" right="5" 
                                 color="0XFFFFFF" fontSize="20"/>
                        
                        <!-- 30x30 filled circle, displays color property -->
                        <s:Ellipse left="5" top="5" bottom="5" width="30" height="30">
                            <s:stroke>
                                <s:SolidColorStroke color="0x000000" weight="2"/>
                            </s:stroke>
                            <s:fill>
                                <s:SolidColor id="colorDisplay"/>
                            </s:fill>
                        </s:Ellipse>
                    </s:GridItemRenderer>
                </fx:Component>
            </s:itemRenderer>
        </s:DataGrid>
    </s:Panel>
</s:Application>