Flash 8 Documentation |
|||
| Components Language Reference > DataGrid component (Flash Professional only) > 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 |
The following table lists methods of the DataGrid class.
|
Method |
Description |
|---|---|
|
Adds a column to the data grid. |
|
|
Adds a column to the data grid at a specified location. |
|
|
Adds an item to the data grid. |
|
|
Adds an item to the data grid at a specified location. |
|
|
Replaces the cell data at a specified location. |
|
|
Gets a reference to a column at a specified location. |
|
|
Gets a reference to the DataGridColumn object at the specified index. |
|
|
Removes all columns from a data grid. |
|
|
Removes a column from a data grid at a specified location. |
|
|
Replaces an item at a specified location with another item. |
|
|
Spaces all columns equally. |
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 |
|---|---|
|
Creates an object on the specified class. |
|
|
Creates a subobject on an object. |
|
|
Destroys a component instance. |
|
|
Calls a function when parameters have been set in the Property and Component inspectors. |
|
|
Gets the style property from the style declaration or object. |
|
|
Marks the object so it is redrawn on the next frame interval. |
|
|
Moves the object to the requested position. |
|
|
Forces validation of the object so it is drawn in the current frame. |
|
|
Resizes the object to the requested size. |
|
|
Sets a skin in the object. |
|
|
Sets the style property on the style declaration or object. |
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 |
|---|---|
|
Returns a reference to the object that has focus. |
|
|
Sets focus to the component instance. |
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 |
|---|---|
|
Adds an item to the end of the list. |
|
|
Adds an item to the list at the specified index. |
|
|
Returns the item at the specified index. |
|
|
Removes all items from the list. |
|
|
Removes the item at the specified index. |
|
|
Replaces the item at the specified index with another item. |
|
|
Applies the specified properties to the specified item. |
|
|
Sorts the items in the list according to the specified compare function. |
|
|
Sorts the items in the list according to a specified property. |
The following table lists the properties of the DataGrid class.
|
Property |
Description |
|---|---|
|
Read-only; the number of columns that are displayed. |
|
|
An array of field names within each item that are displayed as columns. |
|
|
The data model for a data grid. |
|
|
A Boolean value that indicates whether the data grid is editable ( |
|
|
Defines the cell that has focus. |
|
|
The height of the column headers, in pixels. |
|
|
Indicates whether a horizontal scroll bar is present ( |
|
|
A Boolean value that indicates whether the columns are resizable ( |
|
|
A Boolean value that indicates whether the data grid is selectable ( |
|
|
A Boolean value that indicates whether the column headers are visible ( |
|
|
A Boolean value that indicates whether the columns are sortable ( |
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 |
|---|---|
|
The position of the bottom edge of the object, relative to the bottom edge of its parent. Read-only. |
|
|
The height of the object, in pixels. Read-only. |
|
|
The left edge of the object, in pixels. Read-only. |
|
|
The position of the right edge of the object, relative to the right edge of its parent. Read-only. |
|
|
A number indicating the scaling factor in the x direction of the object, relative to its parent. |
|
|
A number indicating the scaling factor in the y direction of the object, relative to its parent. |
|
|
The position of the top edge of the object, relative to its parent. Read-only. |
|
|
A Boolean value indicating whether the object is visible ( |
|
|
The width of the object, in pixels. Read-only. |
|
|
The left edge of the object, in pixels. Read-only. |
|
|
The top edge of the object, in pixels. Read-only. |
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 |
|---|---|
|
Indicates whether the component can receive focus and input. |
|
|
A number indicating the tab order for a component in a document. |
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 |
|---|---|
|
Assigns the class or symbol to use to display each row of the list. |
|
|
The source of the list items. |
|
|
The horizontal position of the list. |
|
|
Indicates whether the horizontal scroll bar is displayed ( |
|
|
A field in each item to be used to specify icons. |
|
|
A function that determines which icon to use. |
|
|
Specifies a field of each item to be used as label text. |
|
|
A function that determines which fields of each item to use for the label text. |
|
|
The number of items in the list. This property is read-only. |
|
|
The number of pixels the list can scroll to the right, when List.hScrollPolicy is set to |
|
|
Indicates whether multiple selection is allowed in the list ( |
|
|
The number of rows that are at least partially visible in the list. |
|
|
The pixel height of every row in the list. |
|
|
Indicates whether the list is selectable ( |
|
|
The index of a selection in a single-selection list. |
|
|
An array of the selected items in a multiple-selection list. |
|
|
The selected item in a single-selection list. This property is read-only. |
|
|
The selected item objects in a multiple-selection list. This property is read-only. |
|
|
Scrolls the list so the topmost visible item is the number assigned. |
|
|
Indicates whether the vertical scroll bar is displayed ( |
The following table lists the events of the DataGrid class.
|
Event |
Description |
|---|---|
|
Broadcast when the cell value has changed. |
|
|
Broadcast when a cell receives focus. |
|
|
Broadcast when a cell loses focus. |
|
|
Broadcast when a cell is pressed (clicked). |
|
|
Broadcast when an item has been selected. |
|
|
Broadcast when a user resizes a column horizontally. |
|
|
Broadcast when a user clicks (releases) a header. |
The following table lists the events the DataGrid class inherits from the UIObject class.
|
Event |
Description |
|---|---|
|
Broadcast when an object is about to draw its graphics. |
|
|
Broadcast when an object's state changes from visible to invisible. |
|
|
Broadcast when subobjects are being created. |
|
|
Broadcast when the object has moved. |
|
|
Broadcast when an object has been resized. |
|
|
Broadcast when an object's state changes from invisible to visible. |
|
|
Broadcast when the subobjects are being unloaded. |
The following table lists the events the DataGrid class inherits from the UIComponent class.
|
Event |
Description |
|---|---|
|
Broadcast when an object receives focus. |
|
|
Broadcast when an object loses focus. |
|
|
Broadcast when a key is pressed. |
|
|
Broadcast when a key is released. |
The following table lists the events the DataGrid class inherits from the List class.
|
Event |
Description |
|---|---|
|
Broadcast whenever user interaction causes the selection to change. |
|
|
Broadcast when the mouse pointer rolls over and then off of list items. |
|
|
Broadcast when the mouse pointer rolls over list items. |
|
|
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