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
Class properties inherited from List
Class properties inherited from ScrollSelectList
Class properties inherited from ScrollView
Class properties inherited from View
Class properties inherited from UIObject
Instance properties
Class methods
Class methods inherited from View
Class methods inherited from UIObject
Instance methods
Event handlers
Event handlers inherited from List
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

        (read)

        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

          editTween:Tween
          (read)

          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

          function addColumn (
          newCol) : DataGridColumn

          Parameters:
          newCol:
          The string name of the new column, or a DataGridColumn
          Returns:
          • the new column

          addColumnAt

          function addColumnAt (
          index:Number, newCol) : DataGridColumn

          Parameters:
          index :
          The index for the new column
          newCol:
          The string name of the new column, or a DataGridColumn
          Returns:
          • the new column

          configureScrolling

          function configureScrolling (
          Void) : Void

          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

          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!

          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

          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.

          findNextEnterCell

          function findNextEnterCell (
          Void) : Void

          generateCols

          function generateCols (
          Void) : Void

          getColumnAt

          function getColumnAt (
          index:Number) : DataGridColumn

          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
          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.
          Overrides:

          notifyStyleChangeInChildren

          function notifyStyleChangeInChildren (
          sheetName:String, styleProp:String, newValue) : Void

          placeSortArrow

          function placeSortArrow (
          Void) : Void

          removeAllColumns

          function removeAllColumns (
          Void) : Void

          removeColumnAt

          function removeColumnAt (
          index:Number) : DataGridColumn

          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

          setColumnNames

          function setColumnNames (
          tmpArray:Array) : Void

          setEnabled

          function setEnabled (
          v:Boolean) : Void

          Overrides:

          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

          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
          Overrides:

          setRowHeight

          function setRowHeight (
          rH:Number) : Void

          setShowHeaders

          function setShowHeaders (
          b:Boolean) : Void

          setVPosition

          function setVPosition (
          pos:Number) : Void

          Overrides:

          showStretcher

          function showStretcher (
          Void) : Void

          size

          function size (
          Void) : Void

          Overrides:

          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

          stopSizing

          function stopSizing (
          Void) : Void

          scoped to header seperator - releases the stretchBar, determines
          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!).

          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)