API Docs for:
Show:

flexiciousNmsp.FlexDataGridCell Class

Extends UIComponent

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:

  • FlexDataGridHeaderCell
  • FlexDataGridFilterCell
  • FlexDataGridFooterCell
  • FlexDataGridPagerCell
  • FlexDataGridLevelRendererCell
  • FlexDataGridExpandCollapseHeaderCell
  • FlexDataGridExpandCollapseCell
  • FlexDataGridPaddingCell
  • 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.

Constructor

flexiciousNmsp.FlexDataGridCell

()

Methods

capitalizeFirstLetterIfPrefix

(
  • val
)
String

If there is a value for the prefix parameter, capitalizes the first word of the val parameter and returns it

Parameters:

  • val Object

Returns:

String:

createColumnIcon

()

createColumnIcon

(
  • evnt
)

when the icon is enables, handles the mouse over event of the icon.

Parameters:

  • evnt Object

createColumnIcon

(
  • evt
)

when the icon is enables, handles the mouse click event of the icon.

Parameters:

  • evt Object

createColumnIcon

(
  • evt
)

Once the timer completed its time, the final result will be renderered such as showing shooltips or dispatching some events.

Parameters:

  • evt Object

destroy

()

destroy function.

drawBackground

(
  • unscaledWidth
  • unscaledHeight
)

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.

  • First, this method will check to see if you have defined a cellCustomBackgroundDrawFunction for the associated column or level. If so, it will call this method, with the cell as a parameter. You can draw a custom background in this function. If you return false, from this function, this method will not execute any other code, and simply call the drawBorders method
  • First, this method will check to see if you have defined a cellCustomBackgroundDrawFunction for the associated column or level. If so, it will call this method, with the cell as a parameter. You can draw a custom background in this function. If you return false, from this function, this method will not execute any other code, and simply call the drawBorders method
Drawing the background using he width and height properties.

Parameters:

  • unscaledWidth Object
  • unscaledHeight Object

drawCell

(
  • unscaledWidth
  • unscaledHeight
)

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.

  • First, this method will check to see if you have defined a cellCustomBackgroundDrawFunction for the associated column or level. If so, it will call this method, with the cell as a parameter. You can draw a custom background in this function. If you return false, from this function, this method will not execute any other code, and simply call the drawBorders method
  • First, this method will check to see if you have defined a cellCustomBackgroundDrawFunction for the associated column or level. If so, it will call this method, with the cell as a parameter. You can draw a custom background in this function. If you return false, from this function, this method will not execute any other code, and simply call the drawBorders method

Parameters:

  • unscaledWidth Object
  • unscaledHeight Object

drawRightBorder

(
  • unscaledWidth
  • unscaledHeight
)

Draws the right border for this cell. There are a few rules on basis of which a right (or a left) border is drawn on a cell.

  • First, if the cell is a Pager cell, no right border is drawn, since the pager shares its left and right border with the grid.
  • Second, if the cell has no vertical gridlines, no border is drawn.
  • Else, if the cell has a column and its right locked, then a left border is drawn.

Parameters:

  • unscaledWidth Object
  • unscaledHeight Object

Returns:

:

getBackgroundColors

() String

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

  • First, it checks to see if this is a filler row. If so, it will use the alternatingItemColors array and return its 0th or 1st index based upton the rowInfo.rowPositionInfo.rowIndex.
  • Next, it checks to see if the cell is disabled. If so, it will return the value of the selectionDisabledColor style property
  • Next, it checks to see if there is a custom cellBackgroundColorFunction on the column and if so, it returns the result of this function
  • Next, it checks to see if there is a custom rowBackgroundColorFunction on the level and if so, it returns the result of this function
  • Next, it checks to see if there rowInfo's data object is in the errors collection of the grid, and if so, it return the value of the errorBackgroundColor property.
  • Next, it checks to see if there enableEditRowHighlight is true amd this row is in edit mode, then it returns the value of the editItemColors style property.
  • Next, it checks to see if there is a value for the currentBackgroundColors property (based upon rollover) and if so returns that. The currentBackgroundColors property is a result of the grid.highlightRow method.

    • If enableActiveCellHighlight=true uses the value of the activeCellColor style.
    • Else, uses the value of the rollOverColor style property.
  • Next, it checks to see if the row is selected (row selection mode) or cell is selected (cell selection mode) and if so, returns selectionColor property.
  • Next, it checks to see if a backgroundColor property is specified on the associated column and if so, returns the value of this property.
  • Finally, it uses the alternatingItemColors array and return its 0th or 1st index based upton the rowInfo.rowPositionInfo.rowIndex.
Getting the BackgroundColors of a FlexDataGridCell

Returns:

String:

getBackgroundColorString

() String

If the cell.backgroundColors is an array, returns a string join using a comma. Else, returns the result of ExtendedUIUtils.getColorName on it.

Returns:

String:

getCheckBoxState

()

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

getColumn

() 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.

Returns:

FlexDataGridColumn:

getDrawTopBorder

() Boolean

Calculated property that controls whether or not to draw the top border. Each cell in Ultimate will draw its own background and border. In order to prevent cells from drawing double borders (cell above me drew bottom border, so I should not need to draw my top border), this flag evaluates to false. But in certain cases, you may want to draw both top and bottom border. The bottom border is always controlled by the horizontalGridLines style property. The top border is controlled by the drawTopBorder style property. In order to provide fine grained control over border drawing functionality, there are the following style properties available.

  • drawTopBorder
  • headerDrawTopBorder
  • footerDrawTopBorder
  • pagerDrawTopBorder
  • filterDrawTopBorder
  • columnGroupDrawTopBorder
To control the bottom border, the following properties are available:
  • horizontalGridLines
  • headerHorizontalGridLines
  • footerHorizontalGridLines
  • pagerHorizontalGridLines
  • filterHorizontalGridLines
  • columnGroupHorizontalGridLines

Returns:

Boolean:

getHorizontalGridLineColor

() String

What color to use to draw the horizontal grid lines for this cell. The value is used to draw the bottom border. Similar to the drawTopBorder, this is a calculated property which is derived from the associated rowInfo object's row type. The result is the value of one of the following based on the rowInfo.rowPositionInfo.rowType:

  • horizontalGridLineColor
  • headerHorizontalGridLineColor
  • footerHorizontalGridLineColor
  • pagerHorizontalGridLineColor
  • filterHorizontalGridLineColor
  • columnHorizontalGridLineColor

Returns:

String:

getHorizontalGridLineThickness

() Number

What thickness to use to draw the horizontal grid lines for this cell. The value is used to draw the bottom border. drawTopBorder Similar to the drawTopBorder, this is a calculated property which is derived from the associated rowInfo object's row type. The result is the value of one of the following based on the rowInfo.rowPositionInfo.rowType:

  • horizontalGridLineThickness
  • headerHorizontalGridLineThickness
  • footerHorizontalGridLineThickness
  • pagerHorizontalGridLineThickness
  • filterHorizontalGridLineThickness
  • columnGroupHorizontalGridLineThickness

Returns:

Number:

getIconUrl

(
  • over
)
String

Parameters:

  • over Object

Returns:

String:

getIExpandCollapseComponent

() IExpandCollapseComponent

Returns:

IExpandCollapseComponent:

getIsChromeCell

() Boolean

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

Returns:

Boolean:

getIsContentArea

() | Boolean

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.

Returns:

| Boolean:

getIsDataCell

() Boolean

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

Returns:

Boolean:

getIsElastic

() Boolean

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

Returns:

Boolean:

getIsExpandCollapseCell

() Boolean

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

Returns:

Boolean:

getIsLeftLocked

() Boolean

Returns true if the column associated with this cell has columnLockMode="left"

Returns:

Boolean:

getIsLocked

() Boolean

Returns true if the column associated with this cell has columnLockMode="left" or columnLockMode="right"

Returns:

Boolean:

getIsNewlyCreated

() Boolean

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.

Returns:

Boolean:

getIsRightLocked

() Boolean

Returns true if the column associated with this cell has columnLockMode="right"

Returns:

Boolean:

getLeftPadding

() Number

Returns:

Number:

getLevel

() FlexDataGrid

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

Returns:

FlexDataGrid:

getLevel

() FlexDataGridColumnLevel

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

Returns:

FlexDataGridColumnLevel:

getLevel

() FlexDataGridColumnLevel

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

Returns:

FlexDataGridColumnLevel:

getNestDepth

() | Number

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;

Returns:

| Number:

getPerceivedX

() Number

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.

Returns:

Number:

getPrefix

()

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

getRenderer

() DisplayObject

The actual renderer component that displays the value of the cell. For all but the FlexDataGridDataCell2 and FlexDataGridDataCell3 there is a separate component that does the rendering. For FlexDataGridDataCell2 and FlexDataGridDataCell3, the cell itself becomes the renderer. This is why both FlexDataGridDataCell2 and FlexDataGridDataCell3 are more performant and optimized than the others. These are also more numerous, since they display data values. The header, filters and footers are relatively smaller in number.

Returns:

DisplayObject:

getRendererFactory

() IFactory

The factory class used for initializing the cell. This is arrived at by calling the deriveRenderer method of the associated column.

Returns:

IFactory:

getRolloverColor

() String

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:

  • rollOverColors
  • headerRollOverColors
  • footerRollOverColors
  • filterRollOverColors
  • pagerRollOverColors
  • columnGroupRollOverColors
Getting the Roll Over Color Of a FlexDataGridCell

Returns:

String:

getRolloverTextColor

() String

Returns the value of the textRollOverColor style property.

Returns:

String:

getRowInfo

() RowInfo

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

Returns:

RowInfo:

getText

() 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.

Returns:

String:

getTextColors

() String

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

  • First, it checks to see if the cell is disabled. If so, it will return the value of the textDisabledColor style property
  • Next, it checks to see if there is a value for the currentTextColors property (based upon rollover) and if so returns that.
  • Next, it checks to see if there is a custom cellTextColorFunction on the column and if so, it returns the result of this function
  • Next, it checks to see if there is a custom rowTextColorFunction on the level and if so, it returns the result of this function
  • Next, it checks to see if there enableEditRowHighlight is true amd this row is in edit mode, then it returns the value of the editTextColor style property.
  • Next, it checks to see if the row is selected (row selection mode) or cell is selected (cell selection mode) and if so, returns textSelectedColor property.
  • Next, it checks to see if a columnTextColor property is specified on the associated column and if so, returns the value of this property.
  • Finally, it uses the alternatingTextColors array and return its 0th or 1st index based upton the rowInfo.rowPositionInfo.rowIndex.
Getting the TextColors of a FlexDataGridCell

Returns:

String:

getVerticalGridLineColor

() String

What color to use to draw the vertical grid lines for this cell. The value is used to draw the right border. drawTopBorder Similar to the drawTopBorder, this is a calculated property which is derived from the associated rowInfo object's row type. The result is the value of one of the following based on the rowInfo.rowPositionInfo.rowType:

  • verticalGridLineColor
  • headerVerticalGridLineColor
  • footerVerticalGridLineColor
  • pagerVerticalGridLineColor
  • filterVerticalGridLineColor
  • columnGroupVerticalGridLineColor

Returns:

String:

getVerticalGridLineThickness

() Number

What thickness to use to draw the horizontal grid lines for this cell. The value is used to draw the bottom border. drawTopBorder Similar to the drawTopBorder, this is a calculated property which is derived from the associated rowInfo object's row type. The result is the value of one of the following based on the rowInfo.rowPositionInfo.rowType:

  • verticalGridLineThickness
  • headerVerticalGridLineThickness
  • footerVerticalGridLineThickness
  • pagerVerticalGridLineThickness
  • filterVerticalGridLineThickness
  • columnGroupVerticalGridLineThickness

Returns:

Number:

getWordWrap

() 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.

Returns:

Boolean:

hasHorizontalGridLines

() Boolean

Returns true if the style property for horizontalGridLines is defined for the type of the row. Based upon the rowInfo.rowPositionInfo.rowType, one of the following properties are inspected:

  • horizontalGridLines
  • headerHorizontalGridLines
  • footerHorizontalGridLines
  • pagerHorizontalGridLines
  • filterHorizontalGridLines
  • columnGroupHorizontalGridLines

Returns:

Boolean:

hasVerticalGridLines

() Boolean

Returns true if the style property for verticalGridLines is defined for the type of the row. Based upon the rowInfo.rowPositionInfo.rowType, one of the following properties are inspected:

  • verticalGridLines
  • headerVerticalGridLines
  • footerVerticalGridLines
  • pagerVerticalGridLines
  • filterVerticalGridLines
  • columnGroupVerticalGridLines
checking the availability of having VerticalGridLiines

Returns:

Boolean:

initializeCheckBoxRenderer

(
  • renderer
)

This method is responsible for initializing the checkbox renderer for both the header and data cells. It performns the following tasks

  • First, it will set the radio button mode of the associated TriStateCheckBox to true if col.radioButtonMode or level.enableSingleSelect is set to true
  • Next, if the grid.enableSelectionExclusion flag is set to true, it will set the selected state of the associated TriStateCheckBox to the result of the getCheckBoxStateBasedOnExclusion method of the level
  • Next, if the grid.enableSelectionExclusion flag is set to false (default), it will set the selected state of the associated TriStateCheckBox based upon the following logic (if enableTriStateCheckBox=true):
    • If the associated rowData object is in the selected objects collection of the level, sets it to checked
    • If any of the children the associated rowData object are selected, sets it to middle
    • Else sets it to unchecked
  • Finally, if the enableLabelAndCheckBox flag is set to true on the column, this method will apply the result of the columns itemToLabel function to the label property of the checkbox

Parameters:

  • renderer Object

invalidateBackground

()

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.

kill

()

Clean up this cell

onIconMouseOut

(
  • evnt
)

when the icon is enables, handles the mouse out event of the icon.

Parameters:

  • evnt Object

placeComponent

(
  • cellRenderer
  • unscaledWidth
  • unscaledHeight
  • usePadding
)

This method will size and place the renderer within the bounds of this cell. The renderer of the cell gets a width of cell.width - paddingLeft - paddingRight. It gets a height of cell.height - paddingTop - paddingBottom. It then gets placed at x position of paddingLeft and y position of paddingTop. The padding is only applied if usePadding is set to true (default).

The padding is calculated on basis of what type of cell this is. The following style properties are used to figure out padding:

  • paddingLeft
  • paddingRight
  • paddingTop
  • paddingBottom
  • headerPaddingLeft
  • headerPaddingRight
  • headerPaddingTop
  • headerPaddingBottom
  • footerPaddingLeft
  • footerPaddingRight
  • footerPaddingTop
  • filterPaddingBottom
  • filterPaddingLeft
  • filterPaddingRight
  • filterPaddingTop
  • filterPaddingBottom
  • columnGroupPaddingBottom
  • columnGroupPaddingLeft
  • columnGroupPaddingRight
  • columnGroupPaddingTop
  • columnGroupPaddingBottom

This method is also used by the edit code, to place the editor. When placing the editor, usePadding is set to falst, so the editor occupies the entire cell to prevent the text of the cells from showing.

Parameters:

  • cellRenderer Object

    The renderer to place. Can be the actual renderer, or the editor.

  • unscaledWidth Object

    The width of the cell.

  • unscaledHeight Object

    The height of the cell.

  • usePadding Object

    Flag to apply padding while figuring out the size of the renderer

Returns:

a new Point object with paddingTop and paddingLeft as y and x properties.

placeExpandCollapseIcon

()

setting the position of ExpandCollapseIcon.

placeIcon

()

setting the correct position of the Icon.

refreshCell

()

Used to refresh the contents of a Cell.

setActualSize

(
  • w
  • h
)

To set the actualsize value using width and height values.

Parameters:

  • w Object
  • h Object

setColumn

(
  • value
)

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

Parameters:

  • value Object

setEnabled

(
  • val
)

Is this enabled cell

Parameters:

  • val Object

setHeight

(
  • value
)

Parameters:

  • value Object

setRendererFactory

(
  • value
)

The factory class used for initializing the cell. This is arrived at by calling the deriveRenderer method of the associated column.

Parameters:

  • value Object

setRendererSize

(
  • cellRenderer
  • w
  • h
)

Given a renderer, sets the size on basis of whether or not there are vertical and horizotnal gridlines . If there are vertical gridlines, sets the width to width minus verticalGridLineThickness If there are vertical gridlines, sets the height to width minus horizontalGridLineThickness

Parameters:

  • cellRenderer Object
  • w Object
  • h Object

setSelectable

(
  • val
)

Parameters:

  • val Object

setText

(
  • val
)

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.

Parameters:

  • val Object

setWidth

(
  • value
)

Setting the width.

Parameters:

  • value Object

setWordWrap

(
  • val
)

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.

Parameters:

  • val Object

updateDisplayList

(
  • unscaledWidth
  • unscaledHeight
)

Validates the width

Parameters:

  • unscaledWidth Object
  • unscaledHeight Object

Properties

_renderer

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.

Default: null

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.

Default: true

colIcon

Image

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

Default: null

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.

Default: null

currentBackgroundColors

Unknown

This property stores the temporary value of a cells background color when the user hovers over it. The background colors of each cell are calculated using a series of rules as defined in the documentation for the getBackgroundColors method of the CellUtils class.

Default: null

currentTextColors

Unknown

This property stores the temporary value of a cells text color when the user hovers over it. The text colors of each cell are calculated using a series of rules as defined in the documentation for the getTextColors method of the CellUtils class.

Default: null

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

Default: null

level

FlexDataGridColumnLevel

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

Default: null

moving

Boolean

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

Default: false

rowInfo

RowInfo

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

Default: null