Packagecom.flexicious.nestedtreedatagrid.cells
Classpublic class FlexDataGridCell
InheritanceFlexDataGridCell Inheritance mx.core.UIComponent
Implements IFlexDataGridCell
Subclasses FlexDataGridColumnGroupCell, FlexDataGridDataCell, FlexDataGridExpandCollapseCell, FlexDataGridFilterCell, FlexDataGridFooterCell, FlexDataGridHeaderCell, FlexDataGridLevelRendererCell, FlexDataGridPaddingCell, FlexDataGridPagerCell

FlexDataGridCell is the container component for each of the DataGrid's cells. This is a psuedo abstract class, the cells that you see in the grid are actually one of the following subclasses of this class: There are two other cells types, FlexDataGridDataCell2 and FlexDataGridDataCell3 (if you set enableDataCellOptimization=true) that do not inherit from this class, but are used in lieu of FlexDataGridDataCell in Flex 4 based grids to improve performance, since they are lighter than FlexDataGridDataCell The FlexDataGridCell is responsible for sizing, positioning (based on padding), drawing the background, and drawing the borders. This class has a renderer property, which is the actual component that is displayed on the UI. In case of the Header,Data or Footer cells the default renderer is a UITextField or UIFTETextField. For Filter, it is an instance of the IFilterControl. For the Pager, it is an IPager control. For the LevelRenderer it is an instance of the Class Factory that you specify in the nextLevelRenderer of the associated column Level. For the ExpandCollapse cells, it will draw an instance of the expand collapse icon on basis of the disclosureIcon style property All the drawing happens in the drawCell method. It seperately calls the drawBackground and drawBorder methods. Usually specifying the style properties, or the cellBackgroud/rowBackground/cellBorder/rowBorder functions is sufficient, but in case its needed, these methods can be overridden in a custom implementation, and this custom implementation can then be hooked in via the dataCellRenderer, headerCellRenderer, footerCellRenderer, pagerCellRenderer, filterCellRender, expandCollapseHeaderCellRenderer,nestIndentPaddingCellRenderer, and expandCollapseCellRenderer of the column or the level. Please note, that this class is recycled, so for example, as you scroll, a FlexDataGridCell object that was displaying some other item in the data provider previously could be reused to display the current one.



Public Properties
 PropertyDefined By
  backgroundColorString : String
[read-only] If column is a checkbox column, returns the current state of the checkbox renderer
FlexDataGridCell
  backgroundDirty : Boolean
A number of operations can cause the cells text and background colors to change.
FlexDataGridCell
  checkBoxState : String
[read-only] If column is a checkbox column, returns the current state of the checkbox renderer
FlexDataGridCell
  colIcon : Image
When column.enableIcon=true, this is the icon that will be associated with the cell.
FlexDataGridCell
  column : FlexDataGridColumn
The FlexDataGridColumn associated with this cell.
FlexDataGridCell
  componentInfo : ComponentInfo
The component info that holds this cell in the cells collection of the associated rowInfo object.
FlexDataGridCell
  currentBackgroundColors : *
FlexDataGridCell
  currentTextColors : *
FlexDataGridCell
  destroyed : Boolean
Once a grid is rendered, each cell in the grid is shown in the UI.
FlexDataGridCell
  drawTopBorder : Boolean
[read-only]
FlexDataGridCell
  expandCollapseIcon : ExpandCollapseIcon
In 2.7, ability was added to have any cell be a expand collapse cell.
FlexDataGridCell
  horizontalGridLineColor : *
[read-only]
FlexDataGridCell
  horizontalGridLineThickness : *
[read-only]
FlexDataGridCell
  iExpandCollapseComponent : IExpandCollapseComponent
[read-only] In 2.7, ability was added to have any cell be a expand collapse cell.
FlexDataGridCell
  isChromeCell : Boolean
[read-only] The "Chrome" is defined as header,footer,pager,filter sections.
FlexDataGridCell
  isContentArea : Boolean
[read-only] Returns true if we are a data cell or if we area a chrome cell at a nest depth of greater than 1.
FlexDataGridCell
  isDataCell : Boolean
[read-only] Returns true if the rowInfo object associated with this cell is of type RowPositionInfo.ROW_TYPE_DATA.
FlexDataGridCell
  isElastic : Boolean
[read-only] Returns true if this cell is not right locked or not fixed width.
FlexDataGridCell
  isExpandCollapseCell : Boolean
[read-only] Calcualted property that returns if this cell is a expand collapse cell.
FlexDataGridCell
  isLeftLocked : Boolean
[read-only]
FlexDataGridCell
  isLocked : Boolean
[read-only]
FlexDataGridCell
  isNewlyCreated : Boolean
[read-only] When a cell is created for the first time, this flag is set to true.
FlexDataGridCell
  isRightLocked : Boolean
[read-only]
FlexDataGridCell
  level : FlexDataGridColumnLevel
The FlexDataGridColumnLevel associated with this cell.
FlexDataGridCell
  moving : Boolean = false
Used by header cells and column group cells for drag drop move.
FlexDataGridCell
  nestDepth : Number
[read-only] Returns the nestpDepth property of the associated level, if it is not null.
FlexDataGridCell
  perceivedX : Number
[read-only] The X Position of this cell, as the user sees it.
FlexDataGridCell
  renderer : DisplayObject
[read-only]
FlexDataGridCell
  rendererFactory : IFactory
FlexDataGridCell
  rowInfo : RowInfo
The rowInfo object associated with this cell.
FlexDataGridCell
  text : String
This is the actual text to display in the cell.
FlexDataGridCell
  verticalGridLineColor : *
[read-only]
FlexDataGridCell
  verticalGridLineThickness : *
[read-only]
FlexDataGridCell
  wordWrap : Boolean
This flag is a used for enabling the wordWrap on the associated renderer.
FlexDataGridCell
Protected Properties
 PropertyDefined By
  prefix : String
[read-only] Returns one of the following values on basis of what type of cell this is: Blank string for data cells header footer filter columnGroup pager
FlexDataGridCell
Public Methods
 MethodDefined By
  
FlexDataGridCell
  
destroy():void
FlexDataGridCell
  
drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
Draws the background as well as calls drawBorder on the given cell Each cell in Ultimate will draw its own background and border.
FlexDataGridCell
  
drawRightBorder(unscaledWidth:Number, unscaledHeight:Number):void
FlexDataGridCell
  
The getBackgroundColors method is responsible for evaluating the background color of the cell.
FlexDataGridCell
  
If this is a fillRow, returns the value of the color property.
FlexDataGridCell
  
If this is a fillRow, returns the value of the color property.
FlexDataGridCell
  
getStyleValue(styleProp:String):*
FlexDataGridCell
  
The getTextColors method is responsible for evaluating the text color of the cell.
FlexDataGridCell
  
FlexDataGridCell
  
FlexDataGridCell
  
initializeCheckBoxRenderer(renderer:DisplayObject):void
FlexDataGridCell
  
Marks the cell so that the background and borders are drawn in the next validation cycle.
FlexDataGridCell
  
placeComponent(cellRenderer:DisplayObject, unscaledWidth:Number, unscaledHeight:Number, usePadding:Boolean = true):Point
FlexDataGridCell
  
FlexDataGridCell
  
setRendererSize(cellRenderer:DisplayObject, w:Number, h:Number):void
FlexDataGridCell
Protected Methods
 MethodDefined By
  
FlexDataGridCell
  
drawCell(unscaledWidth:Number, unscaledHeight:Number):void
FlexDataGridCell
Property Detail
backgroundColorStringproperty
backgroundColorString:String  [read-only]

If column is a checkbox column, returns the current state of the checkbox renderer


Implementation
    public function get backgroundColorString():String
backgroundDirtyproperty 
backgroundDirty:Boolean

A number of operations can cause the cells text and background colors to change. Resizing, mouse interactions, scrolling, hovering, etc. In order to make sure we're not calling the painting and color calculating routines unnecessarily, all these operations simply mark the background as dirty. The is done by calling the invalidateBackground() method. This method will set the backgroundDirty flag to true and call invalidateDisplayList. In the next validation cycle the cell get's its color calculation code executed and painting code will then use the calculated color values to paint the cell.


Implementation
    public function get backgroundDirty():Boolean
    public function set backgroundDirty(value:Boolean):void
checkBoxStateproperty 
checkBoxState:String  [read-only]

If column is a checkbox column, returns the current state of the checkbox renderer


Implementation
    public function get checkBoxState():String
colIconproperty 
public var colIcon:Image

When column.enableIcon=true, this is the icon that will be associated with the cell.

columnproperty 
column:FlexDataGridColumn

The FlexDataGridColumn associated with this cell. Can be null for cells that do not have a column (e.g. ExpandCollapse Cells). For Cells that span multiple columns, it is still the column that this cell starts on.

This property can be used as the source for data binding.


Implementation
    public function get column():FlexDataGridColumn
    public function set column(value:FlexDataGridColumn):void
componentInfoproperty 
componentInfo:ComponentInfo

The component info that holds this cell in the cells collection of the associated rowInfo object. When a row is rendered in the FlexDataGrid, the memory structure used to hold each row is the RowInfo object. If you look at grid.bodyContainer.rows, each item in this collection is an object of type RowInfo. These are the rows in the dataprovider that are currently rendered, which is different than the list of items in the dataprovider. In the cells collection of the rowInfo object, we have a list of ComponentInfo objects. The componentInfo object stores a bunch of additional information and provides a number of handy methods to interact with the cell object. It is basically a wrapper around the IFlexDataGridCell object.


Implementation
    public function get componentInfo():ComponentInfo
    public function set componentInfo(value:ComponentInfo):void
currentBackgroundColorsproperty 
currentBackgroundColors:*


Implementation
    public function get currentBackgroundColors():*
    public function set currentBackgroundColors(value:any):void
currentTextColorsproperty 
currentTextColors:*


Implementation
    public function get currentTextColors():*
    public function set currentTextColors(value:any):void
destroyedproperty 
destroyed:Boolean

Once a grid is rendered, each cell in the grid is shown in the UI. After being shown, if the user performs operations like filtering, or paging, that result in the cell being taken out of view and no longer being rendered on the UI, instead of removing the cell from memory, we store it in the renderer cache of the grid. Prior to decommissioning the cell, we call the destroy method on the cell. This method will set the destroyed flag to true.


Implementation
    public function get destroyed():Boolean
    public function set destroyed(value:Boolean):void
drawTopBorderproperty 
drawTopBorder:Boolean  [read-only]


Implementation
    public function get drawTopBorder():Boolean
expandCollapseIconproperty 
public var expandCollapseIcon:ExpandCollapseIcon

In 2.7, ability was added to have any cell be a expand collapse cell. If you set enableExpandCollapse=true on the column the cells that belong to that column are provided with an iExpandCollapseComponent, which defaults to an instance of

horizontalGridLineColorproperty 
horizontalGridLineColor:*  [read-only]


Implementation
    public function get horizontalGridLineColor():*
horizontalGridLineThicknessproperty 
horizontalGridLineThickness:*  [read-only]


Implementation
    public function get horizontalGridLineThickness():*
iExpandCollapseComponentproperty 
iExpandCollapseComponent:IExpandCollapseComponent  [read-only]

In 2.7, ability was added to have any cell be a expand collapse cell. If you set enableExpandCollapse=true on the column the cells that belong to that column are provided with an iExpandCollapseComponent, which defaults to an instance of


Implementation
    public function get iExpandCollapseComponent():IExpandCollapseComponent
isChromeCellproperty 
isChromeCell:Boolean  [read-only]

The "Chrome" is defined as header,footer,pager,filter sections. This method returns true if this cell belongs to either of these containers.


Implementation
    public function get isChromeCell():Boolean
isContentAreaproperty 
isContentArea:Boolean  [read-only]

Returns true if we are a data cell or if we area a chrome cell at a nest depth of greater than 1. These cells are all drawn in the content area, hence have to scroll. The "Chrome" is defined as header,footer,pager,filter sections. This method returns true if this cell belongs to either of these containers.


Implementation
    public function get isContentArea():Boolean
isDataCellproperty 
isDataCell:Boolean  [read-only]

Returns true if the rowInfo object associated with this cell is of type RowPositionInfo.ROW_TYPE_DATA.


Implementation
    public function get isDataCell():Boolean
isElasticproperty 
isElastic:Boolean  [read-only]

Returns true if this cell is not right locked or not fixed width.


Implementation
    public function get isElastic():Boolean
isExpandCollapseCellproperty 
isExpandCollapseCell:Boolean  [read-only]

Calcualted property that returns if this cell is a expand collapse cell.


Implementation
    public function get isExpandCollapseCell():Boolean
isLeftLockedproperty 
isLeftLocked:Boolean  [read-only]


Implementation
    public function get isLeftLocked():Boolean
isLockedproperty 
isLocked:Boolean  [read-only]


Implementation
    public function get isLocked():Boolean
isNewlyCreatedproperty 
isNewlyCreated:Boolean  [read-only]

When a cell is created for the first time, this flag is set to true. After the cell is no longer needed the cell is put back into the renderer cache. If after being put in the renderer cache, the cell gets called back into action and is added to the display list, this flag will be set to false.


Implementation
    public function get isNewlyCreated():Boolean
isRightLockedproperty 
isRightLocked:Boolean  [read-only]


Implementation
    public function get isRightLocked():Boolean
levelproperty 
level:FlexDataGridColumnLevel

The FlexDataGridColumnLevel associated with this cell. This set on initialize. This is usually never null.

This property can be used as the source for data binding.


Implementation
    public function get level():FlexDataGridColumnLevel
    public function set level(value:FlexDataGridColumnLevel):void
movingproperty 
public var moving:Boolean = false

Used by header cells and column group cells for drag drop move. This property should not be set by your code.

nestDepthproperty 
nestDepth:Number  [read-only]

Returns the nestpDepth property of the associated level, if it is not null. If it is null, returns 1. The top level column has nestDepth=1;


Implementation
    public function get nestDepth():Number
perceivedXproperty 
perceivedX:Number  [read-only]

The X Position of this cell, as the user sees it. Since the Left, Right and Unlocked containers are measuremment frames in themselves, each cell's X is relative to its container. This method converts the measurement of the x value relative to the corresponding parent container to the measurement of X relative to the grid. This is used mainly by keyboard navigation to figure out which cell is to the right or left of the given cell.


Implementation
    public function get perceivedX():Number
prefixproperty 
prefix:String  [read-only]

Returns one of the following values on basis of what type of cell this is:


Implementation
    protected function get prefix():String
rendererproperty 
renderer:DisplayObject  [read-only]


Implementation
    public function get renderer():DisplayObject
rendererFactoryproperty 
rendererFactory:IFactory


Implementation
    public function get rendererFactory():IFactory
    public function set rendererFactory(value:IFactory):void
rowInfoproperty 
rowInfo:RowInfo

The rowInfo object associated with this cell. This cell should be within the cells collection of this rowInfo object.


Implementation
    public function get rowInfo():RowInfo
    public function set rowInfo(value:RowInfo):void
textproperty 
text:String

This is the actual text to display in the cell. This is just a placeholder for the text. Ultimately this value is applied to the renderers text property. This is why, if you specify a custom renderer that exposes a text property, the grid automatically applies the result of the column.itemToLabel method on the associated rowInfo.data object to the text property of the itemRenderer.


Implementation
    public function get text():String
    public function set text(value:String):void
verticalGridLineColorproperty 
verticalGridLineColor:*  [read-only]


Implementation
    public function get verticalGridLineColor():*
verticalGridLineThicknessproperty 
verticalGridLineThickness:*  [read-only]


Implementation
    public function get verticalGridLineThickness():*
wordWrapproperty 
wordWrap:Boolean

This flag is a used for enabling the wordWrap on the associated renderer. Please note, if you define an item renderer, setting wordWrap will only have an impact if you define a renderer that exposes a wordWrap property. When you specify wordWrap on the associated column, the grid will set this flag to true. It will also use a predefined item renderer that has a wordWrap property, unless you specify a custom renderer. If you specify a custom renderer, then this renderer must assume responsibility for exposing a wordWrap property and handling wordWrap appropriately.


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



Method Detail
capitalizeFirstLetterIfPrefix()method
protected function capitalizeFirstLetterIfPrefix(val:String):String

Parameters

val:String

Returns
String
destroy()method 
public function destroy():void

drawBackground()method 
public function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void

Draws the background as well as calls drawBorder on the given cell Each cell in Ultimate will draw its own background and border. This method will use the evaluated results of a number of properties on the cell object to calculate the color, width, and visibility of the background associated with this cell.

Parameters

unscaledWidth:Number
 
unscaledHeight:Number

drawCell()method 
protected function drawCell(unscaledWidth:Number, unscaledHeight:Number):void

Parameters

unscaledWidth:Number
 
unscaledHeight:Number

drawRightBorder()method 
public function drawRightBorder(unscaledWidth:Number, unscaledHeight:Number):void

Parameters

unscaledWidth:Number
 
unscaledHeight:Number

getBackgroundColors()method 
public function getBackgroundColors():*

The getBackgroundColors method is responsible for evaluating the background color of the cell.

Returns
*
getRolloverColor()method 
public function getRolloverColor():*

If this is a fillRow, returns the value of the color property. Else, returns the value of the "prop" property which is the value of one of the following style properties:

Returns
*
getRolloverTextColor()method 
public function getRolloverTextColor():*

If this is a fillRow, returns the value of the color property. Else, returns the value of the "prop" property which is the value of one of the following style properties:

Returns
*
getStyleValue()method 
public function getStyleValue(styleProp:String):*

Parameters

styleProp:String

Returns
*
getTextColors()method 
public function getTextColors():*

The getTextColors method is responsible for evaluating the text color of the cell.

Returns
*
hasHorizontalGridLines()method 
public function hasHorizontalGridLines():Boolean

Returns
Boolean
hasVerticalGridLines()method 
public function hasVerticalGridLines():Boolean

Returns
Boolean
initializeCheckBoxRenderer()method 
public function initializeCheckBoxRenderer(renderer:DisplayObject):void

Parameters

renderer:DisplayObject

invalidateBackground()method 
public function invalidateBackground():void

Marks the cell so that the background and borders are drawn in the next validation cycle. Please, note this does not update or re-evaluate the content of the cell, just the border and the background. To updated the content, call the refreshCell method instead.

placeComponent()method 
public function placeComponent(cellRenderer:DisplayObject, unscaledWidth:Number, unscaledHeight:Number, usePadding:Boolean = true):Point

Parameters

cellRenderer:DisplayObject
 
unscaledWidth:Number
 
unscaledHeight:Number
 
usePadding:Boolean (default = true)

Returns
Point
refreshCell()method 
public function refreshCell():void

setRendererSize()method 
public function setRendererSize(cellRenderer:DisplayObject, w:Number, h:Number):void

Parameters

cellRenderer:DisplayObject
 
w:Number
 
h:Number