DataGrid class (Flash Professional only)

Inheritance MovieClip > UIObject class > UIComponent class > View > ScrollView > ScrollSelectList > List component > DataGrid

ActionScript Class Name mx.controls.DataGrid

Each component class has a version property, which is a class property. Class properties are available only on the class itself. The version property returns a string that indicates the version of the component. To access this property, use the following code:

trace(mx.controls.DataGrid.version);

NOTE

 

The code trace(myDataGridInstance.version); returns undefined.

Method summary for the DataGrid class

The following table lists methods of the DataGrid class.

Method

Description

DataGrid.addColumn()

Adds a column to the data grid.

DataGrid.addColumnAt()

Adds a column to the data grid at a specified location.

DataGrid.addItem()

Adds an item to the data grid.

DataGrid.addItemAt()

Adds an item to the data grid at a specified location.

DataGrid.editField()

Replaces the cell data at a specified location.

DataGrid.getColumnAt()

Gets a reference to a column at a specified location.

DataGrid.getColumnIndex()

Gets a reference to the DataGridColumn object at the specified index.

DataGrid.removeAllColumns()

Removes all columns from a data grid.

DataGrid.removeColumnAt()

Removes a column from a data grid at a specified location.

DataGrid.replaceItemAt()

Replaces an item at a specified location with another item.

DataGrid.spaceColumnsEqually()

Spaces all columns equally.

Methods inherited from the UIObject class

The following table lists the methods the DataGrid class inherits from the UIObject class. When calling these methods, use the form dataGridInstance.methodName.

Method

Description

UIObject.createClassObject()

Creates an object on the specified class.

UIObject.createObject()

Creates a subobject on an object.

UIObject.destroyObject()

Destroys a component instance.

UIObject.doLater()

Calls a function when parameters have been set in the Property and Component inspectors.

UIObject.getStyle()

Gets the style property from the style declaration or object.

UIObject.invalidate()

Marks the object so it is redrawn on the next frame interval.

UIObject.move()

Moves the object to the requested position.

UIObject.redraw()

Forces validation of the object so it is drawn in the current frame.

UIObject.setSize()

Resizes the object to the requested size.

UIObject.setSkin()

Sets a skin in the object.

UIObject.setStyle()

Sets the style property on the style declaration or object.

Methods inherited from the UIComponent class

The following table lists the methods the DataGrid class inherits from the UIComponent class. When calling these methods, use the form dataGridInstance.methodName.

Method

Description

UIComponent.getFocus()

Returns a reference to the object that has focus.

UIComponent.setFocus()

Sets focus to the component instance.

Methods inherited from the List class

The following table lists the methods the DataGrid class inherits from the List class. When calling these methods, use the form dataGridInstance.methodName.

Method

Description

List.addItem()

Adds an item to the end of the list.

List.addItemAt()

Adds an item to the list at the specified index.

List.getItemAt()

Returns the item at the specified index.

List.removeAll()

Removes all items from the list.

List.removeItemAt()

Removes the item at the specified index.

List.replaceItemAt()

Replaces the item at the specified index with another item.

List.setPropertiesAt()

Applies the specified properties to the specified item.

List.sortItems()

Sorts the items in the list according to the specified compare function.

List.sortItemsBy()

Sorts the items in the list according to a specified property.

Property summary for the DataGrid class

The following table lists the properties of the DataGrid class.

Property

Description

DataGrid.columnCount

Read-only; the number of columns that are displayed.

DataGrid.columnNames

An array of field names within each item that are displayed as columns.

DataGrid.dataProvider

The data model for a data grid.

DataGrid.editable

A Boolean value that indicates whether the data grid is editable (true) or not (false).

DataGrid.focusedCell

Defines the cell that has focus.

DataGrid.headerHeight

The height of the column headers, in pixels.

DataGrid.hScrollPolicy

Indicates whether a horizontal scroll bar is present ("on"), not present ("off"), or appears when necessary ("auto").

DataGrid.resizableColumns

A Boolean value that indicates whether the columns are resizable (true) or not (false).

DataGrid.selectable

A Boolean value that indicates whether the data grid is selectable (true) or not (false).

DataGrid.showHeaders

A Boolean value that indicates whether the column headers are visible (true) or not (false).

DataGrid.sortableColumns

A Boolean value that indicates whether the columns are sortable (true) or not (false).

Properties inherited from the UIObject class

The following table lists the properties the DataGrid class inherits from the UIObject class. When accessing these properties from the DataGrid object, use the form dataGridInstance.propertyName.

Property

Description

UIObject.bottom

The position of the bottom edge of the object, relative to the bottom edge of its parent. Read-only.

UIObject.height

The height of the object, in pixels. Read-only.

UIObject.left

The left edge of the object, in pixels. Read-only.

UIObject.right

The position of the right edge of the object, relative to the right edge of its parent. Read-only.

UIObject.scaleX

A number indicating the scaling factor in the x direction of the object, relative to its parent.

UIObject.scaleY

A number indicating the scaling factor in the y direction of the object, relative to its parent.

UIObject.top

The position of the top edge of the object, relative to its parent. Read-only.

UIObject.visible

A Boolean value indicating whether the object is visible (true) or not (false).

UIObject.width

The width of the object, in pixels. Read-only.

UIObject.x

The left edge of the object, in pixels. Read-only.

UIObject.y

The top edge of the object, in pixels. Read-only.

Properties inherited from the UIComponent class

The following table lists the properties the DataGrid class inherits from the UIComponent class. When accessing these properties from the DataGrid object, use the form dataGridInstance.propertyName.

Property

Description

UIComponent.enabled

Indicates whether the component can receive focus and input.

UIComponent.tabIndex

A number indicating the tab order for a component in a document.

Properties inherited from the List class

The following table lists the properties the DataGrid class inherits from the List class. When accessing these properties from the DataGrid object, use the form dataGridInstance.propertyName.

Property

Description

List.cellRenderer

Assigns the class or symbol to use to display each row of the list.

List.dataProvider

The source of the list items.

List.hPosition

The horizontal position of the list.

List.hScrollPolicy

Indicates whether the horizontal scroll bar is displayed ("on") or not ("off").

List.iconField

A field in each item to be used to specify icons.

List.iconFunction

A function that determines which icon to use.

List.labelField

Specifies a field of each item to be used as label text.

List.labelFunction

A function that determines which fields of each item to use for the label text.

List.length

The number of items in the list. This property is read-only.

List.maxHPosition

The number of pixels the list can scroll to the right, when List.hScrollPolicy is set to "on".

List.multipleSelection

Indicates whether multiple selection is allowed in the list (true) or not (false).

List.rowCount

The number of rows that are at least partially visible in the list.

List.rowHeight

The pixel height of every row in the list.

List.selectable

Indicates whether the list is selectable (true) or not (false).

List.selectedIndex

The index of a selection in a single-selection list.

List.selectedIndices

An array of the selected items in a multiple-selection list.

List.selectedItem

The selected item in a single-selection list. This property is read-only.

List.selectedItems

The selected item objects in a multiple-selection list. This property is read-only.

List.vPosition

Scrolls the list so the topmost visible item is the number assigned.

List.vScrollPolicy

Indicates whether the vertical scroll bar is displayed ("on"), not displayed ("off"), or displayed when needed ("auto").

Event summary for the DataGrid class

The following table lists the events of the DataGrid class.

Event

Description

DataGrid.cellEdit

Broadcast when the cell value has changed.

DataGrid.cellFocusIn

Broadcast when a cell receives focus.

DataGrid.cellFocusOut

Broadcast when a cell loses focus.

DataGrid.cellPress

Broadcast when a cell is pressed (clicked).

DataGrid.change

Broadcast when an item has been selected.

DataGrid.columnStretch

Broadcast when a user resizes a column horizontally.

DataGrid.headerRelease

Broadcast when a user clicks (releases) a header.

Events inherited from the UIObject class

The following table lists the events the DataGrid class inherits from the UIObject class.

Event

Description

UIObject.draw

Broadcast when an object is about to draw its graphics.

UIObject.hide

Broadcast when an object's state changes from visible to invisible.

UIObject.load

Broadcast when subobjects are being created.

UIObject.move

Broadcast when the object has moved.

UIObject.resize

Broadcast when an object has been resized.

UIObject.reveal

Broadcast when an object's state changes from invisible to visible.

UIObject.unload

Broadcast when the subobjects are being unloaded.

Events inherited from the UIComponent class

The following table lists the events the DataGrid class inherits from the UIComponent class.

Event

Description

UIComponent.focusIn

Broadcast when an object receives focus.

UIComponent.focusOut

Broadcast when an object loses focus.

UIComponent.keyDown

Broadcast when a key is pressed.

UIComponent.keyUp

Broadcast when a key is released.

Events inherited from the List class

The following table lists the events the DataGrid class inherits from the List class.

Event

Description

List.change

Broadcast whenever user interaction causes the selection to change.

List.itemRollOut

Broadcast when the mouse pointer rolls over and then off of list items.

List.itemRollOver

Broadcast when the mouse pointer rolls over list items.

List.scroll

Broadcast when a list is scrolled.


Version 8

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/8/main/00003260.html