DataGrid
| Kind of class: | class |
|---|---|
| Inherits from: | List < ScrollSelectList < ScrollView < View < UIComponent < UIObject < MovieClip |
| Classpath: | mx.controls.DataGrid |
| File last modified: | Tuesday, 18 December 2007, 15:44:37 |
Summary
Constructor
Class properties
- symbolOwner : Object
- symbolName : String
- version : String
Class properties inherited from List
Class properties inherited from ScrollSelectList
Class properties inherited from ScrollView
Class properties inherited from View
Class properties inherited from UIComponent
Class properties inherited from UIObject
Instance properties
- className : String
- selectable : Boolean
- resizableColumns : Boolean
- __showHeaders : Boolean
- sortableColumns : Boolean
- autoHScrollAble : Boolean
- editable : Boolean
- minColWidth : Number
- totColW : Number
- __rowRenderer : String
- __headerHeight : Number
- hasDrawn : Boolean
- minScrollInterval
- HEADERDEPTH : Number
- LINEDEPTH : Number
- SORTARROWDEPTH : Number
- EDITORDEPTH : Number
- DISABLEDHEADERDEPTH : Number
- HEADERCELLDEPTH : Number
- HEADEROVERLAYDEPTH : Number
- SEPARATORDEPTH : Number
- STRETCHERDEPTH : Number
- columns : Array
- invInitHeaders : Boolean
- invDrawCols : Boolean
- invColChange : Boolean
- invCheckCols : Boolean
- invSpaceColsEqually : Boolean
- lines_mc : MovieClip
- header_mc : MovieClip
- sortArrow : MovieClip
- cellEditor : MovieClip
- editorMask : MovieClip
- stretcher : MovieClip
- stretchBar : MovieClip
- sortIndex : Number
- sortDirection : String
- headerCells : Array
- colX : Number
- oldWidth : Number
- editTween : Tween
- __tabHandlerCache : Function
- dontEdit : Boolean
- __focusedCell : Object
- column : DataGridColumn
- cell : Object
- asc : Boolean
- col : Object
- oldX : Number
- listOwner : Object
- activeGrid : Object
- columnNames : Array
- columnCount : Number
- showHeaders : Boolean
- headerHeight : Number
- focusedCell (obj:Object)
- _inherited_dataProvider : Array
- _inherited_selectedItem : Object
- _inherited_selectedIndex : Number
Instance properties inherited from List
__labels __selectedIndex __vScrollPolicy _inherited_dataProvider _inherited_selectedIndex _inherited_selectedIndices _inherited_selectedItem _inherited_selectedItems autoHScrollAble boundingBox_mc calcPreferredHeightFromData calcPreferredWidthFromData className clipParameters data displayWidth invScrollProps invScrollSize labels oldVWidth scrollDepth totalHeight totalWidth
Instance properties inherited from ScrollSelectList
__cellRenderer __dataProvider __hPosition __iconField __iconFunction __labelField __labelFunction __rowCount __rowHeight __rowRenderer __width addItem addItemAt baseRowZ calcPreferredWidth cellRenderer changeFlag className clearSelected CONTENTDEPTH createLabel dataProvider dragEnabled dragScrolling dropEnabled enabled getDataProvider getItemAt getLength getSelectedIndex getSelectedIndices getSelectedItem getSelectedItems getValue iconField iconField iconFunction iconFunction invLayoutContent invRowHeight invUpdateControl isPressed isRowStyle isSelected labelField labelField labelFunction labelFunction lastPosition lastSelected lastSelID layoutX layoutY length listContent minScrollInterval modelChanged multipleSelection onMouseUp propertyTable removeAll removeItemAt replaceItemAt roundUp rowCount rowCount rowHeight rowHeight rows scrollInterval selectable selected selectedIndex selectedIndices selectedItem selectedItems selectHolder selectionDeleted selectItem setDataProvider setSelectedIndex setSelectedIndices sortItems sortItemsBy tempLabel tH topRowZ tW value wasKeySelected
Instance properties inherited from ScrollView
__hPosition __hScrollPolicy __maxHPosition __viewMetrics __vPosition __vScrollPolicy className columnWidth heightPadding hPosition hScroller hScrollPolicy invLayout MASK_DEPTH mask_mc maxHPosition maxVPosition numberOfCols oldRndUp owner propsInited rowC rowH scrollAreaChanged specialHScrollCase viewableColumns viewableRows vPosition vScroller vScrollPolicy vScrollPolicy widthPadding
Instance properties inherited from View
Instance properties inherited from UIComponent
Instance properties inherited from UIObject
__height __onUnload __width _color _endInit _id _maxHeight _maxWidth _minHeight _minWidth _preferredHeight _preferredWidth _tf _topmost addEventListener bottom buildDepthTable changeColorStyleInChildren changeTextStyleInChildren childrenCreated className clipParameters color createAccessibilityImplementation createChildAtDepth createClassChildAtDepth createEvent dispatchEvent embedFonts findNextAvailableDepth fontFamily fontSize fontStyle fontWeight handleEvent height idNames ignoreClassStyleDeclaration initProperties invalidateFlag left lineColor lineWidth marginLeft marginRight methodTable minHeight minWidth notifyStyleChangeInChildren removeEventListener right scaleX scaleY setStyle stylecache styleName tabEnabled textAlign textDecoration textIndent tfList top validateNow visible width x y
Class methods
Class methods inherited from UIObject
Instance methods
- init
- layoutContent (x:Number, y:Number, tW:Number, tH:Number, dW:Number, dH:Number) : Void
- inherited from list - used to layout the rows inside the list
- setRowCount (rC:Number) : Void
- inherited from list - used to layout a specific number of rows
- setRowHeight (rH:Number) : Void
- setHScrollPolicy (policy:String) : Void
- inherited from list - we're able to accomodate "auto" now.
- setEnabled (v:Boolean) : Void
- modelChanged (eventObj:Object) : Void
- inherited from list - catch any events from the model (see dataProvider spec)
- configureScrolling (Void) : Void
- setVPosition (pos:Number) : Void
- size (Void) : Void
- draw
- editField (index:Number, colName:String, data) : Void
- setColumnNames (tmpArray:Array) : Void
- getColumnNames (Void) : Array
- addColumnAt (index:Number, newCol) : DataGridColumn
- addColumn (newCol) : DataGridColumn
- removeColumnAt (index:Number) : DataGridColumn
- removeAllColumns (Void) : Void
- getColumnAt (index:Number) : DataGridColumn
- getColumnIndex (name:String) : Number
- spaceColumnsEqually (Void) : Void
- generateCols (Void) : Void
- resizeColumn (col:Number, w:Number) : Void
- If no hScrollBar, handles the compacting of other columns when a column has been set
- drawColumns (Void) : Void
- initRows (Void) : Void
- setShowHeaders (b:Boolean) : Void
- getShowHeaders : Boolean
- setHeaderHeight (h:Number) : Void
- getHeaderHeight (Void) : Number
- initHeaders (Void) : Void
- lays out the header assets.
- invalidateHeaderStyle (Void) : Void
- drawHeaderBG (Void) : Void
- enableHeader (v:Boolean) : Void
- placeSortArrow (Void) : Void
- headerRollOver (Void) : Void
- headerRollOut (Void) : Void
- headerPress (Void) : Void
- headerUp (Void) : Void
- headerRelease (Void) : Void
- isStretchable (col:Number) : Boolean
- showStretcher (Void) : Void
- startSizing (Void) : Void
- scoped to header seperator - shows the stretchBar that indicates where
- stopSizing (Void) : Void
- scoped to header seperator - releases the stretchBar, determines
- hideStretcher (Void) : Void
- setFocusedCell (coord:Object, broadCast) : Void
- editorKeyDown (Void) : Void
- tabHandler (Void) : Void
- scoped to the FocusManager.
- findNextEnterCell (Void) : Void
- findNextCell (index:Number, colIndex:Number) : Void
- find the next cell for the grid to TAB to (back or forth).
- disposeEditor (Void) : Void
- Pretty important method.
- editCell
- invalidateStyle (propName:String) : Void
- notifyStyleChangeInChildren (sheetName:String, styleProp:String, newValue) : Void
Instance methods inherited from List
Instance methods inherited from ScrollSelectList
__onMouseUp createChildren dragScroll draw findInputText findString getPropertiesAt getPropertiesOf getRowCount getRowHeight getStateAt getStyle init invalidateStyle keyDown layoutContent moveSelBy onRowDragOut onRowDragOver onRowPress onRowRelease onRowRollOut onRowRollOver selectRow setCellRenderer setEnabled setIconField setIconFunction setLabelField setLabelFunction setPropertiesAt setRowCount setRowHeight setVPosition updateControl
Instance methods inherited from ScrollView
__onMouseWheel childLoaded createChild createChildren doLayout draw getHPosition getHScrollPolicy getMaxHPosition getViewMetrics getVPosition getVScrollPolicy init invalidate onScroll scrollProxy setEnabled setHPosition setHScrollPolicy setMaxHPosition setScrollProperties setVPosition setVScrollPolicy size
Instance methods inherited from View
Instance methods inherited from UIObject
__getTextFormat _createChildren _getTextFormat cancelAllDoLaters constructObject createChildren createClassObject createEmptyObject createLabel createObject createSkin destroyObject doLater doLaterDispatcher draw drawRect getClassStyleDeclaration getMinHeight getMinWidth getSkinIDName getStyle getStyleName init initFromClipParameters invalidate invalidateStyle move redraw setColor setMinHeight setMinWidth setSize setSkin setVisible size
Event handlers
- onRowPress (rowIndex:Number) : Void
- onMouseDown (Void) : Void
- onSetFocus (Void) : Void
- onTweenUpdate (val)
- onTweenEnd (val)
Event handlers inherited from ScrollSelectList
Event handlers inherited from ScrollView
Event handlers inherited from UIComponent
Constructor
DataGrid
function DataGrid (
)
Class properties
symbolName
static symbolName:String = "DataGrid"
(read)
symbolOwner
static symbolOwner:Object = DataGrid
(read)
version
static version:String = "2.0.2.127"
(read)
Instance properties
__focusedCell
__focusedCell:Object
(read)
__headerHeight
__headerHeight:Number = 20
(read)
__rowRenderer
__rowRenderer:String = "DataGridRow"
(read)
__showHeaders
__showHeaders:Boolean = true
(read)
__tabHandlerCache
__tabHandlerCache:Function
(read)
_inherited_dataProvider
_inherited_dataProvider:Array
(read)
Component metadata:
| Bindable | "DataProvider" param1: "writeonly",type |
|---|
_inherited_selectedIndex
_inherited_selectedIndex:Number
(read)
Component metadata:
| Bindable | |
|---|---|
| ChangeEvent | "change" |
_inherited_selectedItem
_inherited_selectedItem:Object
(read)
Component metadata:
| Bindable | "readonly" |
|---|---|
| ChangeEvent | "change" |
activeGrid
activeGrid:Object
(read)
asc
asc:Boolean
(read)
autoHScrollAble
autoHScrollAble:Boolean = true
(read)
cell
cell:Object
(read)
cellEditor
cellEditor:MovieClip
(read)
className
className:String = "DataGrid"
(read)
col
col:Object
(read)
column
columnCount
columnCount:Number
(read)
columnNames
columnNames:Array
(read,write)
columns
columns:Array
(read)
colX
colX:Number
(read)
DISABLEDHEADERDEPTH
DISABLEDHEADERDEPTH:Number = 5003
(read)
dontEdit
dontEdit:Boolean
(read)
editable
editable:Boolean = false
(read)
Component metadata:
| Inspectable | defaultValue: false |
|---|
EDITORDEPTH
EDITORDEPTH:Number = 5002
(read)
editorMask
editorMask:MovieClip
(read)
editTween
focusedCell
focusedCell
(read,write)
hasDrawn
hasDrawn:Boolean = false
(read)
header_mc
header_mc:MovieClip
(read)
HEADERCELLDEPTH
HEADERCELLDEPTH:Number = 4500
(read)
headerCells
headerCells:Array
(read)
HEADERDEPTH
HEADERDEPTH:Number = 5001
(read)
headerHeight
headerHeight:Number
(read,write)
HEADEROVERLAYDEPTH
HEADEROVERLAYDEPTH:Number = 4000
(read)
invCheckCols
invCheckCols:Boolean
(read)
invColChange
invColChange:Boolean
(read)
invDrawCols
invDrawCols:Boolean
(read)
invInitHeaders
invInitHeaders:Boolean
(read)
invSpaceColsEqually
invSpaceColsEqually:Boolean
(read)
LINEDEPTH
LINEDEPTH:Number = 5000
(read)
lines_mc
lines_mc:MovieClip
(read)
listOwner
listOwner:Object
(read)
minColWidth
minColWidth:Number = 20
(read)
minScrollInterval
minScrollInterval = 60
(read)
oldWidth
oldWidth:Number
(read)
oldX
oldX:Number
(read)
resizableColumns
resizableColumns:Boolean = true
(read)
selectable
selectable:Boolean = true
(read)
SEPARATORDEPTH
SEPARATORDEPTH:Number = 5000
(read)
showHeaders
showHeaders:Boolean
(read,write)
sortableColumns
sortableColumns:Boolean = true
(read)
sortArrow
sortArrow:MovieClip
(read)
SORTARROWDEPTH
SORTARROWDEPTH:Number = 5500
(read)
sortDirection
sortDirection:String
(read)
sortIndex
sortIndex:Number
(read)
stretchBar
stretchBar:MovieClip
(read)
stretcher
stretcher:MovieClip
(read)
STRETCHERDEPTH
STRETCHERDEPTH:Number = 1000
(read)
totColW
totColW:Number = 0
(read)
Instance methods
addColumn
Parameters:
newCol:
The string name of the new column, or a DataGridColumn
Returns:
- the new column
addColumnAt
Parameters:
index :
The index for the new column
newCol:
The string name of the new column, or a DataGridColumn
Returns:
- the new column
disposeEditor
function disposeEditor (
Void) : Void
Pretty important method. Get rid of all the baggage we're lugging as part of
the cellEditor setup. This includes the keyListener, restoring the focusManager
to its pristine state, removing the editor, and firing the focus out event
the cellEditor setup. This includes the keyListener, restoring the focusManager
to its pristine state, removing the editor, and firing the focus out event
draw
function draw (
)
inherited from list - the most important method in the component. draw basically dispatches all
scheduled drawing work in the right sequence to get a properly rendered grid. Don't mess with the order!
scheduled drawing work in the right sequence to get a properly rendered grid. Don't mess with the order!
drawColumns
function drawColumns (
Void) : Void
drawHeaderBG
function drawHeaderBG (
Void) : Void
editCell
function editCell (
)
Take the stuff from the cellEditor, and store it in the dataProvider. Dispose
Fire the edit event (including the old value of the cell), and dispose the editor
Fire the edit event (including the old value of the cell), and dispose the editor
editField
function editField (
index:Number,
colName:String,
data) : Void
Parameters:
index :
the index of the item to edit
colName:
the name of the field to edit
data :
the new data to put in the edited field
editorKeyDown
function editorKeyDown (
Void) : Void
enableHeader
function enableHeader (
v:Boolean) : Void
findNextCell
function findNextCell (
index:Number,
colIndex:Number) : Void
find the next cell for the grid to TAB to (back or forth). If the cell to be focused
falls out of range (the end or beggining of the grid) then move focus outside the grid.
falls out of range (the end or beggining of the grid) then move focus outside the grid.
findNextEnterCell
function findNextEnterCell (
Void) : Void
generateCols
function generateCols (
Void) : Void
getColumnAt
Parameters:
index:
the index of the column to retrieve
Returns:
- the column
getColumnIndex
function getColumnIndex (
name:String) : Number
Parameters:
name:
the name of the column whose index is desired
Returns:
- the column index
getColumnNames
function getColumnNames (
Void) : Array
getHeaderHeight
function getHeaderHeight (
Void) : Number
getShowHeaders
function getShowHeaders (
) : Boolean
headerPress
function headerPress (
Void) : Void
headerRelease
function headerRelease (
Void) : Void
headerRollOut
function headerRollOut (
Void) : Void
headerRollOver
function headerRollOver (
Void) : Void
headerUp
function headerUp (
Void) : Void
hideStretcher
function hideStretcher (
Void) : Void
init
function init (
)
initHeaders
function initHeaders (
Void) : Void
lays out the header assets. Note the backGround is done later
initRows
function initRows (
Void) : Void
invalidateHeaderStyle
function invalidateHeaderStyle (
Void) : Void
invalidateStyle
function invalidateStyle (
propName:String) : Void
isStretchable
function isStretchable (
col:Number) : Boolean
layoutContent
function layoutContent (
x:Number,
y:Number,
tW:Number,
tH:Number,
dW:Number,
dH:Number) : Void
inherited from list - used to layout the rows inside the list
Here we extend it to accomodate the headerHeight, and to ensure that
if the width has changed, we draw more header background
Here we extend it to accomodate the headerHeight, and to ensure that
if the width has changed, we draw more header background
Overrides:
modelChanged
function modelChanged (
eventObj:Object) : Void
inherited from list - catch any events from the model (see dataProvider spec)
optimize for editing one cell - also generateCols in cases where there are none.
optimize for editing one cell - also generateCols in cases where there are none.
Overrides:
notifyStyleChangeInChildren
function notifyStyleChangeInChildren (
sheetName:String,
styleProp:String,
newValue) : Void
placeSortArrow
function placeSortArrow (
Void) : Void
removeAllColumns
function removeAllColumns (
Void) : Void
removeColumnAt
Parameters:
index:
The index of the column to remove
Returns:
- the removed column
resizeColumn
function resizeColumn (
col:Number,
w:Number) : Void
If no hScrollBar, handles the compacting of other columns when a column has been set
to a specific size. Doesn't move anything, just calculates widths..
In the case of an hScrollBar, set a new maxHPosition
to a specific size. Doesn't move anything, just calculates widths..
In the case of an hScrollBar, set a new maxHPosition
setColumnNames
function setColumnNames (
tmpArray:Array) : Void
setFocusedCell
function setFocusedCell (
coord:Object,
broadCast) : Void
setHeaderHeight
function setHeaderHeight (
h:Number) : Void
setHScrollPolicy
function setHScrollPolicy (
policy:String) : Void
inherited from list - we're able to accomodate "auto" now.
extend it to make sure column widths stay in synch
extend it to make sure column widths stay in synch
Overrides:
setRowCount
function setRowCount (
rC:Number) : Void
inherited from list - used to layout a specific number of rows
Here we extend it to accomodate the headerHeight
Here we extend it to accomodate the headerHeight
Overrides:
setRowHeight
function setRowHeight (
rH:Number) : Void
setShowHeaders
function setShowHeaders (
b:Boolean) : Void
showStretcher
function showStretcher (
Void) : Void
spaceColumnsEqually
function spaceColumnsEqually (
Void) : Void
startSizing
function startSizing (
Void) : Void
scoped to header seperator - shows the stretchBar that indicates where
a column stretch will leave the column's right side
a column stretch will leave the column's right side
stopSizing
function stopSizing (
Void) : Void
scoped to header seperator - releases the stretchBar, determines
how much to resize the column.
how much to resize the column.
tabHandler
function tabHandler (
Void) : Void
scoped to the FocusManager. How fun!! activeGrid is the grid in question
tabHandler is focusManager's method for catching the TAB. We replace it
with this when the grid gets focus, and restore it to normal afterwards. This method
should only be active while there is a focused cellEditor in the grid (or tabbing will break!).
tabHandler is focusManager's method for catching the TAB. We replace it
with this when the grid gets focus, and restore it to normal afterwards. This method
should only be active while there is a focused cellEditor in the grid (or tabbing will break!).
Event handlers
onMouseDown
function onMouseDown (
Void) : Void
onRowPress
function onRowPress (
rowIndex:Number) : Void
onSetFocus
function onSetFocus (
Void) : Void
onTweenEnd
function onTweenEnd (
val)
onTweenUpdate
function onTweenUpdate (
val)