Packagecom.flexicious.nestedtreedatagrid
Classpublic class FlexDataGridBodyContainer
InheritanceFlexDataGridBodyContainer Inheritance FlexDataGridContainerBase Inheritance mx.core.Container
Subclasses FlexDataGridVirtualBodyContainer

FlexDataGridBodyContainer is the container for the unlocked section of the datagrid. This is the only container in the entire component tree that scrolls. In addition to all the base functionality that it inherits from FlexDataGridContainerBase, it adds the following pieces of functionality: FlexDataGridContainerBase is the base class for each of the containers of the grid. The Header, Footer, Pager and Filter Rows. The grid has the following containers: The filter, header, footer and pager containers are of type FlexDataGridChromeContainer that inherit from FlexDataGridContainerBase.



Public Properties
 PropertyDefined By
 InheritedcolumnDraggingDragCell : FlexDataGridCell
When a column is being dragged and dropped into a different location, this variable holds the cell that is being dragged.
FlexDataGridContainerBase
 InheritedcolumnResizingCell : FlexDataGridHeaderCell
When a column is being resized, this variable holds the cell that initiated the resize operation.
FlexDataGridContainerBase
 InheritedenableHorizontalRecycling : Boolean = true
Flag to turn on horizontal scroll recycle.
FlexDataGridContainerBase
 Inheritedgrid : FlexDataGrid
The grid that we belong to
FlexDataGridContainerBase
 InheritedinEdit : Boolean
[read-only] Returns true if grid is in edit mode
FlexDataGridContainerBase
 InheriteditemClickTimerDuration : Number = 250
Duration, in milliseconds to wait until dispatching a new ITEM_CLICK event.
FlexDataGridContainerBase
 InheriteditemVerticalPositions : Array
[read-only] Row positions
FlexDataGridContainerBase
  loadedItems : ArrayCollection
[read-only] In lazy loaded grid levels, (filterPageSortMode=server), when the user expands a level for the first time, since the data is not loaded, the level dispatches the filterPageSortChange, or itemLoad.
FlexDataGridBodyContainer
  onScreenRows : Array
[read-only] Returns the number of rows currently visible.
FlexDataGridBodyContainer
  openItems : ArrayCollection
A list of items that the user has opened.
FlexDataGridBodyContainer
 Inheritedrows : ArrayCollection
Collection of RowInfo objects currently being displayed.
FlexDataGridContainerBase
  validNextPage : Boolean
[read-only] Returns true if there is another page of data.
FlexDataGridBodyContainer
  variableRowHeightRenderers : KeyValuePairCollection
Active only when the body containers calculateRowHeight method is running.
FlexDataGridBodyContainer
Protected Properties
 PropertyDefined By
 InheritedcellsWithColSpanOrRowSpan : Array
Once we are through calculating rowspans and colspans, we go through this array, popping cells and hiding cells that are covered by the increased col and row spans of the cells in this array.
FlexDataGridContainerBase
 InheritededitCell : IFlexDataGridDataCell
FlexDataGridContainerBase
 Inheritededitor : UIComponent
FlexDataGridContainerBase
 InheriteditemClickTimer : Timer
Timer to prevent double click from causing two item clicks.
FlexDataGridContainerBase
 Inherited_keyboardhandled : Boolean = false
FlexDataGridContainerBase
 InheritedlastSelectedRowIndex : int = -1
Last selected Row Index
FlexDataGridContainerBase
Public Methods
 MethodDefined By
  
Constructor
FlexDataGridBodyContainer
  
calculateTotalHeight(flat:Object = null, level:FlexDataGridColumnLevel = null, heightSoFar:Number = 0, nestLevel:int = 0, expanding:RowPositionInfo = null, addedRows:Array = null, parentObject:Object = null, isRecursive:Boolean = false):int
Dual purpose function, one to calculate height, second to figure out that at vertical position Y, the seed record to be shown is?.
FlexDataGridBodyContainer
 Inherited
cancelEdit(event:Event):void
Cancels the current running edit.
FlexDataGridContainerBase
  
Clears out the variable row height renderers
FlexDataGridBodyContainer
 Inherited
Used by accesibility
FlexDataGridContainerBase
 Inherited
endEdit(editor:UIComponent, event:Event = null):void
Dispatches ITEM_EDIT_END.
FlexDataGridContainerBase
 Inherited
filterPageSort(flat:Object, level:FlexDataGridColumnLevel, parentObj:Object, applyFilter:Boolean = true, applyPaging:Boolean = true, applySort:Boolean = true, pages:Array = null, updatePager:Boolean = false):Object
FlexDataGridContainerBase
 Inherited
findLoadingInfo(item:Object, level:FlexDataGridColumnLevel, useSelectedKeyField:Boolean = false):ItemLoadInfo
In lazy loaded grids, gets the loaded info of the provided object.
FlexDataGridContainerBase
 Inherited
getCellForRowColumn(dataObject:Object, col:FlexDataGridColumn, includeExp:Boolean = false):IFlexDataGridCell
Given a column and a data object, returns the cell associated with the data object.
FlexDataGridContainerBase
 Inherited
getCellInDirection(thisCell:IFlexDataGridCell, direction:String, dataOnly:Boolean = false, editableOnly:Boolean = false, scrollIfNecessary:Boolean = true, hoverableOnly:Boolean = false):IFlexDataGridCell
Gets the cell in the specified direction of the provided cell
FlexDataGridContainerBase
 Inherited
getChildAtId(arr:Array, id:uint):IFlexDataGridCell
Used by accesibility
FlexDataGridContainerBase
 Inherited
getChildId(arr:Array, cell:IFlexDataGridCell):uint
Used by accesibility
FlexDataGridContainerBase
 Inherited
getChildIds(arr:Array):void
Used by accesibility
FlexDataGridContainerBase
 Inherited
The IFlexDataGridCell under edit currently.
FlexDataGridContainerBase
 Inherited
getCurrentEditor():UIComponent
The editor being used as the current component to edit.
FlexDataGridContainerBase
 Inherited
Gets the first cell of the first column.
FlexDataGridContainerBase
 Inherited
getFirstHoverableCell(row:RowInfo, dataOnly:Boolean = false, editableOnly:Boolean = false):IFlexDataGridCell
FlexDataGridContainerBase
  
Returns the RowPosition Info object for the item at the given vertical scroll position
FlexDataGridBodyContainer
  
ets a copy of the calculated item vertical positions
FlexDataGridBodyContainer
  
getObjectStack(itemToFind:Object, stackSoFar:Array, useItemKeyForCompare:Boolean, flat:Object = null, level:FlexDataGridColumnLevel = null):Boolean
Given an object at any level, returns an array containing information about that object, followed by its parent, until the top of the tree is reached, in reverse order.
FlexDataGridBodyContainer
 Inherited
getSelectedIds(bodyStart:uint):Array
Used by accesibility
FlexDataGridContainerBase
  
gotoItem(item:Object, highlight:Boolean, useItemKeyForCompare:Boolean, level:FlexDataGridColumnLevel = null, rebuild:Boolean = true):Boolean
Given a data item, scrolls to that item in the datagrid If the use item Key For compare parameter is set to true, uses the selectedKeyField value of the item to identify the item.
FlexDataGridBodyContainer
  
gotoRow(rowIndex:int):Boolean
Given a row index (less than the total number of rows, goes to the row in question).
FlexDataGridBodyContainer
  
gotoVerticalPosition(vsp:Number):void
Goes to the vertical position specified by the parameter.
FlexDataGridBodyContainer
 Inherited
handleArrowKey(cell:IFlexDataGridCell, keyCode:uint, triggerEvent:Event):Boolean
Handles cell key up.
FlexDataGridContainerBase
 Inherited
handleCellKeyUp(cell:IFlexDataGridCell, keyCode:uint, triggerEvent:Event):void
Handles cell key up.
FlexDataGridContainerBase
 Inherited
handleEditorKeyEvent(event:KeyboardEvent, cell:IFlexDataGridCell):void
FlexDataGridContainerBase
 Inherited
initializeEditor(editCell:IFlexDataGridDataCell, editor:UIComponent, pare:UIComponent):void
FlexDataGridContainerBase
 Inherited
initializeFilterRenderer(filterRenderer:IFilterControl, filterColumn:FlexDataGridColumn, item:Object, flatDp:Object, level:FlexDataGridColumnLevel):void
Given a filter control, initializes it from the provided column
FlexDataGridContainerBase
 Inherited
Calls invalidateBackground() on each of the cells.
FlexDataGridContainerBase
 Inherited
[override]
FlexDataGridContainerBase
 Inherited
Given a cell, returns true if the cell is "hidden" by another cell that has a col span which will cover this cell.
FlexDataGridContainerBase
 Inherited
Given a cell, returns true if the cell is "hidden" by another cell that has a row span which will cover this cell.
FlexDataGridContainerBase
 Inherited
Can this cell accept hover.
FlexDataGridContainerBase
  
[override] Returnes true if the row's vertical position is less than the grids vertical scroll bar position or if the rows vertical position plus rows height is greater than the grids vertical position plus grid height.
FlexDataGridBodyContainer
  
isYOutOfVisibleArea(numY:Number, numH:Number):Boolean
Returnes true if the row's vertical position is less than the grids vertical scroll bar position or if the rows vertical position plus rows height is greater than the grids vertical position plus grid height.
FlexDataGridBodyContainer
  
nextPage():void
Goes to the next page of data.
FlexDataGridBodyContainer
 Inherited
onHeaderCellClicked(cell:FlexDataGridHeaderCell, triggerEvent:Event, isMsc:Boolean = false, useMsc:Boolean = true, direction:String = null):void
FlexDataGridContainerBase
 Inherited
populateValue(event:Event, itemEditor:UIComponent = null):Boolean
Applies the value from the editor back to the model object.
FlexDataGridContainerBase
  
quickFind(whatToFind:String, flat:Object = null, level:FlexDataGridColumnLevel = null, result:Array = null, searchCols:Array = null, breakAfterFind:Boolean = true, captureCols:Boolean = false):Array
Iterates through the data provider to get a list of objects that match the text provided.
FlexDataGridBodyContainer
 Inherited
reDraw():void
Calls removeAllComponents, createComponents, validateNow, and snapToColumnWidths
FlexDataGridContainerBase
 Inherited
Re-evaluates all the visible cell contents.
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
removeAllComponents(recycle:Boolean):void
End the edit, if active, call removeComponent on each of the rows, and remove all the children.
FlexDataGridContainerBase
  
scrollToExistingRow(vsp:Number, scrollDown:Boolean):void
[override] Scrolls to a row that is already drawn.
FlexDataGridBodyContainer
  
selectText(txt:String):void
Selects the provided text in the currently visible cells that have the default item renderer, or if the item renderer has the selection property
FlexDataGridBodyContainer
 Inherited
Sets the current highlight cell to the first available cell.
FlexDataGridContainerBase
  
Sets the records in the visible range.
FlexDataGridBodyContainer
  
shiftColumns(columnToInsert:FlexDataGridColumn, insertBefore:FlexDataGridColumn):void
Inserts the column specified column before the specified column
FlexDataGridBodyContainer
 Inherited
sortByColumn(col:FlexDataGridColumn, direction:String = null):void
FlexDataGridContainerBase
Protected Methods
 MethodDefined By
 Inherited
Based upon the type of the cell, adds various event listeners to them to respond to mouse overs, clicks, double clicks, mouse outs, keyboard input, etc.
FlexDataGridContainerBase
 Inherited
addPadding(nestLevel:int, row:RowInfo, paddingHeight:Number, level:FlexDataGridColumnLevel, forceRightLock:Boolean = false, scrollPad:Boolean = false, width:int = -1):FlexDataGridPaddingCell
FlexDataGridContainerBase
 Inherited
Starts the Edit Session.
FlexDataGridContainerBase
  
binarySearch(arr:Array, verticalPos:Number, low:int, high:int):RowPositionInfo
On basis of the vertical scroll position provided, does a quick binary lookup of the record to be shown at that row.
FlexDataGridBodyContainer
 Inherited
Given the mouse event, figures out which cell is the drop target.
FlexDataGridContainerBase
 Inherited
checkRowSpanColSpan(retCell:IFlexDataGridCell, thisCell:IFlexDataGridCell, direction:String, dataOnly:Boolean, editableOnly:Boolean, scrollIfNecessary:Boolean, hoverableOnly:Boolean):IFlexDataGridCell
FlexDataGridContainerBase
 Inherited
[override]
FlexDataGridContainerBase
 Inherited
getAllRows():ArrayCollection
Gets the Rows Collection
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
Given a cell, gets the colspan associated with that cell by calling the grid.colSpanFunction.
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
Given a cell, gets the rowSpan associated with that cell by calling the grid.rowSpanFunction.
FlexDataGridContainerBase
 Inherited
handleDoubleClick(cell:IFlexDataGridCell, triggerEvent:Event):void
Handles the Double Click.
FlexDataGridContainerBase
 Inherited
handleMouseClick(cell:IFlexDataGridCell, triggerEvent:Event, checkTimer:Boolean = true):void
Handles the Mouse click.
FlexDataGridContainerBase
 Inherited
handleMouseOut(cell:IFlexDataGridCell, triggerEvent:Event):void
Handles mouse out.
FlexDataGridContainerBase
 Inherited
handleMouseOver(cell:IFlexDataGridCell, triggerEvent:Event):void
Handles mouse over for data cells.
FlexDataGridContainerBase
 Inherited
handleSpaceBar(cell:IFlexDataGridCell, triggerEvent:Event):void
FlexDataGridContainerBase
 Inherited
Once the snapToColumnWidths finishes, the cellsWithColSpanOrRowSpan array contains all cells that have a row or col span.
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
onCellMouseClick(event:MouseEvent):void
Handles mouse click.
FlexDataGridContainerBase
 Inherited
onCellMouseOver(event:MouseEvent):void
Handles Cell Mouse Over.
FlexDataGridContainerBase
 Inherited
onEditorKeyDown(event:KeyboardEvent):void
Handles the KeyDown on the Editor Component.
FlexDataGridContainerBase
 Inherited
onItemClickTimer(event:TimerEvent):void
FlexDataGridContainerBase
 Inherited
onMouseMove(event:MouseEvent):void
FlexDataGridContainerBase
 Inherited
onSelectAllChanged(event:Event):void
FlexDataGridContainerBase
 Inherited
placeSortIcon(event:Event):void
FlexDataGridContainerBase
 Inherited
Removes the component from its parents hierarchy, and calls destroy method, if the component is a IFlexDataGridCell object Hangs on to the component in the cache for further reuse.
FlexDataGridContainerBase
 Inherited
Iterates through all rows and calls removeComponent on each of the cells.
FlexDataGridContainerBase
 Inherited
selectAllChangedHandler(event:Event):void
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
FlexDataGridContainerBase
 Inherited
storeSort(item:Object, column:FlexDataGridColumn, ascending:Boolean):void
FlexDataGridContainerBase
 Inherited
updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
[override]
FlexDataGridContainerBase
Events
 Event Summary Defined By
 InheritedDispatched when the columns at any level are resized.FlexDataGridContainerBase
 InheritedDispatched when the header cells are clickedFlexDataGridContainerBase
Property Detail
loadedItemsproperty
loadedItems:ArrayCollection  [read-only]

In lazy loaded grid levels, (filterPageSortMode=server), when the user expands a level for the first time, since the data is not loaded, the level dispatches the filterPageSortChange, or itemLoad. This event is then handled by client code, and when the data is retreieved from the server, the setChildData method is called. This method will store the results in this array collection.


Implementation
    public function get loadedItems():ArrayCollection
onScreenRowsproperty 
onScreenRows:Array  [read-only]

Returns the number of rows currently visible.


Implementation
    public function get onScreenRows():Array
openItemsproperty 
openItems:ArrayCollection

A list of items that the user has opened. Only applicable grids with nested column levels.


Implementation
    public function get openItems():ArrayCollection
    public function set openItems(value:ArrayCollection):void
validNextPageproperty 
validNextPage:Boolean  [read-only]

Returns true if there is another page of data.


Implementation
    public function get validNextPage():Boolean
variableRowHeightRenderersproperty 
public var variableRowHeightRenderers:KeyValuePairCollection

Active only when the body containers calculateRowHeight method is running. This dictionary will be purged as soon as calculateRowHeight is done running.

Constructor Detail
FlexDataGridBodyContainer()Constructor
public function FlexDataGridBodyContainer(grid:FlexDataGrid)

Constructor

Parameters
grid:FlexDataGrid
Method Detail
binarySearch()method
protected function binarySearch(arr:Array, verticalPos:Number, low:int, high:int):RowPositionInfo

On basis of the vertical scroll position provided, does a quick binary lookup of the record to be shown at that row.

Parameters

arr:Array
 
verticalPos:Number
 
low:int
 
high:int

Returns
RowPositionInfo
calculateTotalHeight()method 
public function calculateTotalHeight(flat:Object = null, level:FlexDataGridColumnLevel = null, heightSoFar:Number = 0, nestLevel:int = 0, expanding:RowPositionInfo = null, addedRows:Array = null, parentObject:Object = null, isRecursive:Boolean = false):int

Dual purpose function, one to calculate height, second to figure out that at vertical position Y, the seed record to be shown is?.

Parameters

flat:Object (default = null)
 
level:FlexDataGridColumnLevel (default = null)
 
heightSoFar:Number (default = 0)
 
nestLevel:int (default = 0)
 
expanding:RowPositionInfo (default = null)
 
addedRows:Array (default = null)
 
parentObject:Object (default = null)
 
isRecursive:Boolean (default = false)

Returns
int
clearVariableRowHeightRenderes()method 
public function clearVariableRowHeightRenderes():void

Clears out the variable row height renderers

getItemAtPosition()method 
public function getItemAtPosition(position:Number):RowPositionInfo

Returns the RowPosition Info object for the item at the given vertical scroll position

Parameters

position:Number

Returns
RowPositionInfo
getItemVerticalPositions()method 
public function getItemVerticalPositions():Array

ets a copy of the calculated item vertical positions

Returns
Array
getObjectStack()method 
public function getObjectStack(itemToFind:Object, stackSoFar:Array, useItemKeyForCompare:Boolean, flat:Object = null, level:FlexDataGridColumnLevel = null):Boolean

Given an object at any level, returns an array containing information about that object, followed by its parent, until the top of the tree is reached, in reverse order. The array contains a list of ItemPositionInfo objects, which contains that object itself, its index, as well as the page number it appears on, if enablePaging is set to true else -1.

Parameters

itemToFind:Object
 
stackSoFar:Array
 
useItemKeyForCompare:Boolean
 
flat:Object (default = null)
 
level:FlexDataGridColumnLevel (default = null)

Returns
Boolean
gotoItem()method 
public function gotoItem(item:Object, highlight:Boolean, useItemKeyForCompare:Boolean, level:FlexDataGridColumnLevel = null, rebuild:Boolean = true):Boolean

Given a data item, scrolls to that item in the datagrid If the use item Key For compare parameter is set to true, uses the selectedKeyField value of the item to identify the item. Flexicious by default will only build RowPositionInfo objects for open items that the user can visually scroll to. So items that are closed, or are on a different page, will not be built, and cannot be scrolled to. If you set rebuildRowPositions to true, the function will inspect the data provider to find the item in question, and build the RowPositionInfo for it if its not found in the currently built RowPositionInfo objects.

Parameters

item:Object
 
highlight:Boolean
 
useItemKeyForCompare:Boolean
 
level:FlexDataGridColumnLevel (default = null)
 
rebuild:Boolean (default = true)

Returns
Boolean
gotoRow()method 
public function gotoRow(rowIndex:int):Boolean

Given a row index (less than the total number of rows, goes to the row in question). Row index becomes the first visible row. Please note this is a 1 based index.

Parameters

rowIndex:int

Returns
Boolean
gotoVerticalPosition()method 
public function gotoVerticalPosition(vsp:Number):void

Goes to the vertical position specified by the parameter. Recycles the renderers

Parameters

vsp:Number

isOutOfVisibleArea()method 
override public function isOutOfVisibleArea(row:RowInfo):Boolean

Returnes true if the row's vertical position is less than the grids vertical scroll bar position or if the rows vertical position plus rows height is greater than the grids vertical position plus grid height.

Parameters

row:RowInfo

Returns
Boolean
isYOutOfVisibleArea()method 
public function isYOutOfVisibleArea(numY:Number, numH:Number):Boolean

Returnes true if the row's vertical position is less than the grids vertical scroll bar position or if the rows vertical position plus rows height is greater than the grids vertical position plus grid height.

Parameters

numY:Number
 
numH:Number

Returns
Boolean
nextPage()method 
public function nextPage():void

Goes to the next page of data.

quickFind()method 
public function quickFind(whatToFind:String, flat:Object = null, level:FlexDataGridColumnLevel = null, result:Array = null, searchCols:Array = null, breakAfterFind:Boolean = true, captureCols:Boolean = false):Array

Iterates through the data provider to get a list of objects that match the text provided.

Parameters

whatToFind:String
 
flat:Object (default = null)
 
level:FlexDataGridColumnLevel (default = null)
 
result:Array (default = null)
 
searchCols:Array (default = null)
 
breakAfterFind:Boolean (default = true)
 
captureCols:Boolean (default = false)

Returns
Array
scrollToExistingRow()method 
override public function scrollToExistingRow(vsp:Number, scrollDown:Boolean):void

Scrolls to a row that is already drawn.

Parameters

vsp:Number
 
scrollDown:Boolean

selectText()method 
public function selectText(txt:String):void

Selects the provided text in the currently visible cells that have the default item renderer, or if the item renderer has the selection property

Parameters

txt:String

setVisibleRange()method 
public function setVisibleRange():void

Sets the records in the visible range.

shiftColumns()method 
public function shiftColumns(columnToInsert:FlexDataGridColumn, insertBefore:FlexDataGridColumn):void

Inserts the column specified column before the specified column

Parameters

columnToInsert:FlexDataGridColumn
 
insertBefore:FlexDataGridColumn