適用於 Adobe® Flash® Platform 的 ActionScript® 3.0 參考
首頁  |  隱藏套件和類別清單 |  套件  |  類別  |  新增內容  |  索引  |  附錄  |  為什麼顯示英文?
篩選: AIR 30.0 和更早版本, Flash Player 30.0 和更早版本, Flash Lite 4
Flex 4.6 和更早版本, Flash Pro CS6 和更早版本
隱藏篩選
spark.components.gridClasses 

GridColumn  - AS3 Flex

套件x

最上層
adobe.utils
air.desktop
air.net
air.update
air.update.events
coldfusion.air
coldfusion.air.errors
coldfusion.air.events
coldfusion.service
coldfusion.service.events
coldfusion.service.mxml
com.adobe.acm.solutions.authoring.domain.extensions
com.adobe.acm.solutions.ccr.domain.extensions
com.adobe.consulting.pst.vo
com.adobe.dct.component
com.adobe.dct.component.datadictionary
com.adobe.dct.component.datadictionaryElement
com.adobe.dct.component.dataElementsPanel
com.adobe.dct.component.toolbars
com.adobe.dct.event
com.adobe.dct.exp
com.adobe.dct.model
com.adobe.dct.service
com.adobe.dct.service.provider
com.adobe.dct.transfer
com.adobe.dct.util
com.adobe.dct.view
com.adobe.ep.taskmanagement.domain
com.adobe.ep.taskmanagement.event
com.adobe.ep.taskmanagement.filter
com.adobe.ep.taskmanagement.services
com.adobe.ep.taskmanagement.util
com.adobe.ep.ux.attachmentlist.component
com.adobe.ep.ux.attachmentlist.domain
com.adobe.ep.ux.attachmentlist.domain.events
com.adobe.ep.ux.attachmentlist.domain.renderers
com.adobe.ep.ux.attachmentlist.skin
com.adobe.ep.ux.attachmentlist.skin.renderers
com.adobe.ep.ux.content.event
com.adobe.ep.ux.content.factory
com.adobe.ep.ux.content.handlers
com.adobe.ep.ux.content.managers
com.adobe.ep.ux.content.model.asset
com.adobe.ep.ux.content.model.preview
com.adobe.ep.ux.content.model.relation
com.adobe.ep.ux.content.model.search
com.adobe.ep.ux.content.model.toolbar
com.adobe.ep.ux.content.search
com.adobe.ep.ux.content.services
com.adobe.ep.ux.content.services.load
com.adobe.ep.ux.content.services.permissions
com.adobe.ep.ux.content.services.preview
com.adobe.ep.ux.content.services.providers
com.adobe.ep.ux.content.services.query
com.adobe.ep.ux.content.services.relationships
com.adobe.ep.ux.content.services.search.lccontent
com.adobe.ep.ux.content.services.version
com.adobe.ep.ux.content.view
com.adobe.ep.ux.content.view.components.activate
com.adobe.ep.ux.content.view.components.grid
com.adobe.ep.ux.content.view.components.grid.hover
com.adobe.ep.ux.content.view.components.grid.hover.component
com.adobe.ep.ux.content.view.components.grid.renderers
com.adobe.ep.ux.content.view.components.relationships
com.adobe.ep.ux.content.view.components.review
com.adobe.ep.ux.content.view.components.search.renderers
com.adobe.ep.ux.content.view.components.searchpod
com.adobe.ep.ux.content.view.components.toolbar
com.adobe.ep.ux.content.view.components.toolbar.controlRenderers
com.adobe.ep.ux.content.view.components.version
com.adobe.ep.ux.documentsubmit.component
com.adobe.ep.ux.documentsubmit.domain
com.adobe.ep.ux.documentsubmit.skin
com.adobe.ep.ux.taskaction.component
com.adobe.ep.ux.taskaction.domain
com.adobe.ep.ux.taskaction.domain.events
com.adobe.ep.ux.taskaction.skin
com.adobe.ep.ux.taskdetails.component
com.adobe.ep.ux.taskdetails.domain
com.adobe.ep.ux.taskdetails.skin
com.adobe.ep.ux.tasklist.component
com.adobe.ep.ux.tasklist.domain
com.adobe.ep.ux.tasklist.skin
com.adobe.ep.ux.webdocumentviewer.domain
com.adobe.exm.expression
com.adobe.exm.expression.error
com.adobe.exm.expression.event
com.adobe.exm.expression.impl
com.adobe.fiber.runtime.lib
com.adobe.fiber.services
com.adobe.fiber.services.wrapper
com.adobe.fiber.styles
com.adobe.fiber.util
com.adobe.fiber.valueobjects
com.adobe.gravity.binding
com.adobe.gravity.context
com.adobe.gravity.flex.bundleloader
com.adobe.gravity.flex.progress
com.adobe.gravity.flex.serviceloader
com.adobe.gravity.framework
com.adobe.gravity.init
com.adobe.gravity.service.bundleloader
com.adobe.gravity.service.logging
com.adobe.gravity.service.manifest
com.adobe.gravity.service.progress
com.adobe.gravity.tracker
com.adobe.gravity.ui
com.adobe.gravity.utility
com.adobe.gravity.utility.async
com.adobe.gravity.utility.error
com.adobe.gravity.utility.events
com.adobe.gravity.utility.factory
com.adobe.gravity.utility.flex.async
com.adobe.gravity.utility.logging
com.adobe.gravity.utility.message
com.adobe.gravity.utility.sequence
com.adobe.gravity.utility.url
com.adobe.guides.control
com.adobe.guides.domain
com.adobe.guides.i18n
com.adobe.guides.spark.components.skins
com.adobe.guides.spark.components.skins.mx
com.adobe.guides.spark.headers.components
com.adobe.guides.spark.headers.skins
com.adobe.guides.spark.layouts.components
com.adobe.guides.spark.layouts.skins
com.adobe.guides.spark.navigators.components
com.adobe.guides.spark.navigators.renderers
com.adobe.guides.spark.navigators.skins
com.adobe.guides.spark.util
com.adobe.guides.spark.wrappers.components
com.adobe.guides.spark.wrappers.skins
com.adobe.guides.submit
com.adobe.icc.dc.domain
com.adobe.icc.dc.domain.factory
com.adobe.icc.editors.events
com.adobe.icc.editors.handlers
com.adobe.icc.editors.managers
com.adobe.icc.editors.model
com.adobe.icc.editors.model.config
com.adobe.icc.editors.model.el
com.adobe.icc.editors.model.el.operands
com.adobe.icc.editors.model.el.operators
com.adobe.icc.enum
com.adobe.icc.external.dc
com.adobe.icc.obj
com.adobe.icc.services
com.adobe.icc.services.category
com.adobe.icc.services.config
com.adobe.icc.services.download
com.adobe.icc.services.export
com.adobe.icc.services.external
com.adobe.icc.services.formbridge
com.adobe.icc.services.fragmentlayout
com.adobe.icc.services.layout
com.adobe.icc.services.letter
com.adobe.icc.services.locator
com.adobe.icc.services.module
com.adobe.icc.services.render
com.adobe.icc.services.submit
com.adobe.icc.services.user
com.adobe.icc.token
com.adobe.icc.vo
com.adobe.icc.vo.render
com.adobe.icomm.assetplacement.controller
com.adobe.icomm.assetplacement.controller.utils
com.adobe.icomm.assetplacement.data
com.adobe.icomm.assetplacement.model
com.adobe.livecycle.assetmanager.client
com.adobe.livecycle.assetmanager.client.event
com.adobe.livecycle.assetmanager.client.handler
com.adobe.livecycle.assetmanager.client.managers
com.adobe.livecycle.assetmanager.client.model
com.adobe.livecycle.assetmanager.client.model.cms
com.adobe.livecycle.assetmanager.client.service
com.adobe.livecycle.assetmanager.client.service.search
com.adobe.livecycle.assetmanager.client.service.search.cms
com.adobe.livecycle.assetmanager.client.utils
com.adobe.livecycle.content
com.adobe.livecycle.rca.model
com.adobe.livecycle.rca.model.constant
com.adobe.livecycle.rca.model.document
com.adobe.livecycle.rca.model.participant
com.adobe.livecycle.rca.model.reminder
com.adobe.livecycle.rca.model.stage
com.adobe.livecycle.rca.service
com.adobe.livecycle.rca.service.core
com.adobe.livecycle.rca.service.core.delegate
com.adobe.livecycle.rca.service.process
com.adobe.livecycle.rca.service.process.delegate
com.adobe.livecycle.rca.token
com.adobe.livecycle.ria.security.api
com.adobe.livecycle.ria.security.service
com.adobe.mosaic.layouts
com.adobe.mosaic.layouts.dragAndDrop
com.adobe.mosaic.layouts.interfaces
com.adobe.mosaic.mxml
com.adobe.mosaic.om.constants
com.adobe.mosaic.om.events
com.adobe.mosaic.om.impl
com.adobe.mosaic.om.interfaces
com.adobe.mosaic.skinning
com.adobe.mosaic.sparklib.editors
com.adobe.mosaic.sparklib.optionMenu
com.adobe.mosaic.sparklib.scrollableMenu
com.adobe.mosaic.sparklib.scrollableMenu.skins
com.adobe.mosaic.sparklib.tabLayout
com.adobe.mosaic.sparklib.tabLayout.events
com.adobe.mosaic.sparklib.tabLayout.layouts
com.adobe.mosaic.sparklib.tabLayout.skins
com.adobe.mosaic.sparklib.text
com.adobe.mosaic.sparklib.util
com.adobe.solutions.acm.authoring.presentation
com.adobe.solutions.acm.authoring.presentation.actionbar
com.adobe.solutions.acm.authoring.presentation.common
com.adobe.solutions.acm.authoring.presentation.events
com.adobe.solutions.acm.authoring.presentation.fragment
com.adobe.solutions.acm.authoring.presentation.letter
com.adobe.solutions.acm.authoring.presentation.letter.data
com.adobe.solutions.acm.authoring.presentation.preview
com.adobe.solutions.acm.authoring.presentation.rte
com.adobe.solutions.acm.ccr.presentation
com.adobe.solutions.acm.ccr.presentation.contentcapture
com.adobe.solutions.acm.ccr.presentation.contentcapture.events
com.adobe.solutions.acm.ccr.presentation.contentcapture.preview
com.adobe.solutions.acm.ccr.presentation.datacapture
com.adobe.solutions.acm.ccr.presentation.datacapture.renderers
com.adobe.solutions.acm.ccr.presentation.pdf
com.adobe.solutions.exm
com.adobe.solutions.exm.authoring
com.adobe.solutions.exm.authoring.components.controls
com.adobe.solutions.exm.authoring.components.toolbars
com.adobe.solutions.exm.authoring.domain
com.adobe.solutions.exm.authoring.domain.expression
com.adobe.solutions.exm.authoring.domain.impl
com.adobe.solutions.exm.authoring.domain.method
com.adobe.solutions.exm.authoring.domain.variable
com.adobe.solutions.exm.authoring.enum
com.adobe.solutions.exm.authoring.events
com.adobe.solutions.exm.authoring.model
com.adobe.solutions.exm.authoring.renderer
com.adobe.solutions.exm.authoring.view
com.adobe.solutions.exm.expression
com.adobe.solutions.exm.impl
com.adobe.solutions.exm.impl.method
com.adobe.solutions.exm.method
com.adobe.solutions.exm.mock
com.adobe.solutions.exm.mock.method
com.adobe.solutions.exm.runtime
com.adobe.solutions.exm.runtime.impl
com.adobe.solutions.exm.variable
com.adobe.solutions.prm.constant
com.adobe.solutions.prm.domain
com.adobe.solutions.prm.domain.factory
com.adobe.solutions.prm.domain.impl
com.adobe.solutions.prm.domain.manager
com.adobe.solutions.prm.presentation.asset
com.adobe.solutions.prm.presentation.constant
com.adobe.solutions.prm.presentation.document
com.adobe.solutions.prm.presentation.event
com.adobe.solutions.prm.presentation.file
com.adobe.solutions.prm.presentation.project
com.adobe.solutions.prm.presentation.team
com.adobe.solutions.prm.presentation.util
com.adobe.solutions.prm.service
com.adobe.solutions.prm.services.impl
com.adobe.solutions.prm.vo
com.adobe.solutions.rca.constant
com.adobe.solutions.rca.domain
com.adobe.solutions.rca.domain.common
com.adobe.solutions.rca.domain.factory
com.adobe.solutions.rca.domain.impl
com.adobe.solutions.rca.domain.impl.manager
com.adobe.solutions.rca.domain.manager
com.adobe.solutions.rca.presentation
com.adobe.solutions.rca.presentation.comment
com.adobe.solutions.rca.presentation.constant
com.adobe.solutions.rca.presentation.event
com.adobe.solutions.rca.presentation.gantt
com.adobe.solutions.rca.presentation.gantt.ruler
com.adobe.solutions.rca.presentation.template
com.adobe.solutions.rca.presentation.template.audit
com.adobe.solutions.rca.presentation.template.definition
com.adobe.solutions.rca.presentation.template.documents
com.adobe.solutions.rca.presentation.template.stages
com.adobe.solutions.rca.presentation.util
com.adobe.solutions.rca.service
com.adobe.solutions.rca.services.impl
com.adobe.solutions.rca.vo
com.adobe.solutions.rca.vo.um
com.adobe.viewsource
fl.accessibility
fl.containers
fl.controls
fl.controls.dataGridClasses
fl.controls.listClasses
fl.controls.progressBarClasses
fl.core
fl.data
fl.display
fl.events
fl.ik
fl.lang
fl.livepreview
fl.managers
fl.motion
fl.motion.easing
fl.rsl
fl.text
fl.transitions
fl.transitions.easing
fl.video
flash.accessibility
flash.concurrent
flash.crypto
flash.data
flash.desktop
flash.display
flash.display3D
flash.display3D.textures
flash.errors
flash.events
flash.external
flash.filesystem
flash.filters
flash.geom
flash.globalization
flash.html
flash.media
flash.net
flash.net.dns
flash.net.drm
flash.notifications
flash.permissions
flash.printing
flash.profiler
flash.sampler
flash.security
flash.sensors
flash.system
flash.text
flash.text.engine
flash.text.ime
flash.ui
flash.utils
flash.xml
flashx.textLayout
flashx.textLayout.compose
flashx.textLayout.container
flashx.textLayout.conversion
flashx.textLayout.edit
flashx.textLayout.elements
flashx.textLayout.events
flashx.textLayout.factory
flashx.textLayout.formats
flashx.textLayout.operations
flashx.textLayout.utils
flashx.undo
ga.controls
ga.layouts
ga.model
ga.uiComponents
ga.util
ga.views
ga.wrappers
lc.foundation
lc.foundation.domain
lc.foundation.events
lc.foundation.ui
lc.foundation.util
lc.preloader
lc.procmgmt
lc.procmgmt.commands
lc.procmgmt.domain
lc.procmgmt.events
lc.procmgmt.formbridge
lc.procmgmt.impl
lc.procmgmt.ui.attachments
lc.procmgmt.ui.controls
lc.procmgmt.ui.controls.card
lc.procmgmt.ui.controls.renderer
lc.procmgmt.ui.help
lc.procmgmt.ui.layout
lc.procmgmt.ui.presentationmodel
lc.procmgmt.ui.process
lc.procmgmt.ui.search
lc.procmgmt.ui.startpoint
lc.procmgmt.ui.task
lc.procmgmt.ui.task.form
lc.procmgmt.ui.task.form.commands
lc.procmgmt.ui.tracking
mx.accessibility
mx.automation
mx.automation.air
mx.automation.delegates
mx.automation.delegates.advancedDataGrid
mx.automation.delegates.charts
mx.automation.delegates.containers
mx.automation.delegates.controls
mx.automation.delegates.controls.dataGridClasses
mx.automation.delegates.controls.fileSystemClasses
mx.automation.delegates.core
mx.automation.delegates.flashflexkit
mx.automation.events
mx.binding
mx.binding.utils
mx.charts
mx.charts.chartClasses
mx.charts.effects
mx.charts.effects.effectClasses
mx.charts.events
mx.charts.renderers
mx.charts.series
mx.charts.series.items
mx.charts.series.renderData
mx.charts.styles
mx.collections
mx.collections.errors
mx.containers
mx.containers.accordionClasses
mx.containers.dividedBoxClasses
mx.containers.errors
mx.containers.utilityClasses
mx.controls
mx.controls.advancedDataGridClasses
mx.controls.dataGridClasses
mx.controls.listClasses
mx.controls.menuClasses
mx.controls.olapDataGridClasses
mx.controls.scrollClasses
mx.controls.sliderClasses
mx.controls.textClasses
mx.controls.treeClasses
mx.controls.videoClasses
mx.core
mx.core.windowClasses
mx.data
mx.data.crypto
mx.data.errors
mx.data.events
mx.data.messages
mx.data.mxml
mx.data.offline.errors
mx.data.utils
mx.effects
mx.effects.easing
mx.effects.effectClasses
mx.events
mx.filters
mx.flash
mx.formatters
mx.geom
mx.graphics
mx.graphics.codec
mx.graphics.shaderClasses
mx.logging
mx.logging.errors
mx.logging.targets
mx.managers
mx.messaging
mx.messaging.channels
mx.messaging.config
mx.messaging.errors
mx.messaging.events
mx.messaging.management
mx.messaging.messages
mx.modules
mx.netmon
mx.olap
mx.olap.aggregators
mx.preloaders
mx.printing
mx.resources
mx.rpc
mx.rpc.events
mx.rpc.http
mx.rpc.http.mxml
mx.rpc.livecycle
mx.rpc.mxml
mx.rpc.remoting
mx.rpc.remoting.mxml
mx.rpc.soap
mx.rpc.soap.mxml
mx.rpc.wsdl
mx.rpc.xml
mx.skins
mx.skins.halo
mx.skins.spark
mx.skins.wireframe
mx.skins.wireframe.windowChrome
mx.states
mx.styles
mx.utils
mx.validators
org.osmf.containers
org.osmf.display
org.osmf.elements
org.osmf.events
org.osmf.layout
org.osmf.logging
org.osmf.media
org.osmf.metadata
org.osmf.net
org.osmf.net.dvr
org.osmf.net.httpstreaming
org.osmf.net.metrics
org.osmf.net.qos
org.osmf.net.rtmpstreaming
org.osmf.net.rules
org.osmf.traits
org.osmf.utils
spark.accessibility
spark.automation.delegates
spark.automation.delegates.components
spark.automation.delegates.components.gridClasses
spark.automation.delegates.components.mediaClasses
spark.automation.delegates.components.supportClasses
spark.automation.delegates.skins.spark
spark.automation.events
spark.collections
spark.components
spark.components.calendarClasses
spark.components.gridClasses
spark.components.mediaClasses
spark.components.supportClasses
spark.components.windowClasses
spark.core
spark.effects
spark.effects.animation
spark.effects.easing
spark.effects.interpolation
spark.effects.supportClasses
spark.events
spark.filters
spark.formatters
spark.formatters.supportClasses
spark.globalization
spark.globalization.supportClasses
spark.layouts
spark.layouts.supportClasses
spark.managers
spark.modules
spark.preloaders
spark.primitives
spark.primitives.supportClasses
spark.skins
spark.skins.mobile
spark.skins.mobile.supportClasses
spark.skins.spark
spark.skins.spark.mediaClasses.fullScreen
spark.skins.spark.mediaClasses.normal
spark.skins.spark.windowChrome
spark.skins.wireframe
spark.skins.wireframe.mediaClasses
spark.skins.wireframe.mediaClasses.fullScreen
spark.transitions
spark.utils
spark.validators
spark.validators.supportClasses
xd.core.axm.enterprise.view.components
xd.core.axm.enterprise.view.skins
xd.core.axm.view.components
xd.core.axm.view.components.support

語言元素

全域常數
全域函數
運算子
陳述式、關鍵字和指令
特殊類型

附錄

新增內容
編譯器錯誤
編譯器警告
執行階段錯誤
移轉至 ActionScript 3
支援的字元集
僅限 MXML 標籤
移動 XML 元素
Timed Text 標籤
不建議元素清單
AccessibilityImplementation 常數
如何使用 ActionScript 範例
法律聲明
套件spark.components.gridClasses
類別public class GridColumn
繼承GridColumn Inheritance EventDispatcher Inheritance Object

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The GridColumn class defines a column of a Spark grid control, such as the Spark DataGrid or Grid control. Each data provider item for the control corresponds to one row of the grid. The GridColumn class specifies the field of the data provider item whose value is to be displayed in the column. It also specifies the item renderer used to display that value, the item editor used to change the value, and other properties of the column.

MXML 語法expanded隱藏 MXML 語法

The <s:GridColumn> tag inherits all of the tag attributes of its superclass and adds the following tag attributes:

  <s:GridColumn
    Properties
    dataField="null"
    dataTipField="null"
    dataTipFormatter="null"
    dataTipFunction="null"
    editable="true"
    formatter="null"
    headerRenderer="null"
    headerText="value of dataField"
    imeMode="null"
    itemEditor="null"
    itemRenderer="null"
    itemRendererFunction="null"
    labelFunction="null"
    maxWidth="NaN"
    minWidth="20"
    rendererIsEditable="false"
    resizeable="true"
    showDataTips="undefined"
    sortable="true"
    sortCompareFunction="null"
    sortDescending="false"
    visible="true"
    width="NaN"
  />
  

檢視範例

相關 API 元素



公用屬性
 屬性定義自
  columnIndex : int
[唯讀] The position of this column in the grid's column list, or -1 if this column's grid is null.
GridColumn
 Inheritedconstructor : Object
類別物件的參照或是特定物件實體的建構函數。
Object
  dataField : String
The name of the field or property in the data provider item associated with the column.
GridColumn
  dataTipField : String
The name of the field in the data provider to display as the datatip.
GridColumn
  dataTipFormatter : IFormatter
Specifies the formatter used by the column's itemToDataTip() method to convert data provider items to Strings.
GridColumn
  dataTipFunction : Function
Specifies a callback function to run on each item of the data provider to determine its data tip.
GridColumn
  editable : Boolean
Indicates whether the items in the column are editable.
GridColumn
  formatter : IFormatter
Specifies the formatter used by the column's itemToLabel() method to convert data provider items to strings.
GridColumn
  grid : Grid
[唯讀] The Grid object associated with this column.
GridColumn
  headerRenderer : IFactory
The class factory for the IGridItemRenderer class used as the header for this column.
GridColumn
  headerText : String
Text for the header of this column.
GridColumn
  imeMode : String
Specifies the IME (Input Method Editor) mode.
GridColumn
  itemEditor : IFactory
A class factory for IGridItemEditor class used to edit individual grid cells in this column.
GridColumn
  itemRenderer : IFactory
The class factory for the IGridItemRenderer class used to render individual grid cells.
GridColumn
  itemRendererFunction : Function
If specified, the value of this property must be an idempotent function that returns an item renderer IFactory based on its data provider item and column parameters.
GridColumn
  labelFunction : Function
An idempotent function that converts a data provider item into a column-specific string that's used to initialize the item renderer's label property.
GridColumn
  maxWidth : Number
The maximum width of this column in pixels.
GridColumn
  minWidth : Number
The minimum width of this column in pixels.
GridColumn
  rendererIsEditable : Boolean
Determines whether any of the item renderer's controls are editable.
GridColumn
  resizable : Boolean
Indicates whether the user is allowed to resize the width of the column.
GridColumn
  showDataTips : *
Indicates whether the datatips are shown in the column.
GridColumn
  sortable : Boolean
If true, and if the grid's data provider is an ICollectionView, and if the associated grid's sortableColumns property is true, then this column supports interactive sorting.
GridColumn
  sortCompareFunction : Function
The function that compares two elements during a sort of on the data elements of this column.
GridColumn
  sortDescending : Boolean
If true, this column is sorted in descending order.
GridColumn
  sortField : SortField
[唯讀] Returns a SortField that can be used to sort a collection by this column's dataField.
GridColumn
  visible : Boolean
If true, then display this column.
GridColumn
  width : Number
The width of this column in pixels.
GridColumn
公用方法
 方法定義自
  
GridColumn(columnName:String = null)
Constructor.
GridColumn
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
會在 EventDispatcher 物件註冊事件偵聽程式,以便讓偵聽程式收到事件的通知。
EventDispatcher
 Inherited
會將事件傳送到事件流程。
EventDispatcher
 Inherited
會檢查 EventDispatcher 物件是否有對特定的事件類型註冊偵聽程式。
EventDispatcher
 Inherited
指出物件是否有已定義的指定屬性。
Object
 Inherited
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。
Object
  
Convert the specified data provider item to a column-specific datatip String.
GridColumn
  
Convert the specified data provider item to a column-specific String.
GridColumn
  
Convert the specified data provider item to a column-specific item renderer factory.
GridColumn
 Inherited
指出指定的屬性是否存在,以及是否可列舉。
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
會從 EventDispatcher 物件移除偵聽程式。
EventDispatcher
 Inherited
為迴圈作業設定動態屬性的可用性。
Object
 Inherited
傳回代表此物件的字串,根據地區特定慣例進行格式化。
Object
 Inherited
會傳回指定之物件的字串形式。
Object
 Inherited
會傳回指定之物件的基本值。
Object
 Inherited
檢查此 EventDispatcher 物件是否已註冊事件偵聽程式,或者此物件的任何祖系已為特定事件類型註冊事件偵聽程式。
EventDispatcher
事件
 事件 摘要 定義自
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式取得作業系統焦點並成為作用中時傳送。EventDispatcher
 Inherited[廣播事件] 當 Flash Player 或 AIR 應用程式失去作業系統焦點並成為非作用中時傳送。EventDispatcher
公用常數
 常數定義自
  ERROR_TEXT : String = "unknown"
[靜態] The return value for the itemToLabel() or itemToDataTip() method if resolving the corresponding property name (path) fails.
GridColumn
屬性詳細資訊

columnIndex

屬性
columnIndex:int  [唯讀]

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The position of this column in the grid's column list, or -1 if this column's grid is null.

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 columnIndexChanged 事件。



實作
    public function get columnIndex():int

dataField

屬性 
dataField:String

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The name of the field or property in the data provider item associated with the column. Each GridColumn requires this property or the labelFunction property to be set to calculate the displayable text for the item renderer. If the dataField and labelFunction properties are set, the data is displayed using the labelFunction and sorted using the dataField.

This value of this property is not necessarily the String that is displayed in the column header. This property is used only to access the data in the data provider. For more information, see the headerText property.

If the column or its grid specifies a labelFunction, then the dataField is not used.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 dataFieldChanged 事件。



實作
    public function get dataField():String
    public function set dataField(value:String):void

相關 API 元素

dataTipField

屬性 
dataTipField:String

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The name of the field in the data provider to display as the datatip. By default, if showDataTips is true, the associated grid control looks for a property named label on each data provider item and displays it. However, if the data provider does not contain a label property, you can set the dataTipField property to specify a different property name. For example, you could set the value to "FullName" when a user views a set of people's names included from a database.

GridColumn.dataTipField takes precedence over this property.

If this column or its grid specifies a value for the dataTipFunction property, then the dataTipField property is ignored.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 dataTipFieldChanged 事件。



實作
    public function get dataTipField():String
    public function set dataTipField(value:String):void

相關 API 元素

dataTipFormatter

屬性 
dataTipFormatter:IFormatter

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Specifies the formatter used by the column's itemToDataTip() method to convert data provider items to Strings.

If the formatter's styleParent was not specified, it's set to the column's grid, so that the formatter inherits the grid's locale style.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 dataTipFormatterChanged 事件。



實作
    public function get dataTipFormatter():IFormatter
    public function set dataTipFormatter(value:IFormatter):void

相關 API 元素

dataTipFunction

屬性 
dataTipFunction:Function

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Specifies a callback function to run on each item of the data provider to determine its data tip. This property is used by the itemToDataTip method.

By default, if showDataTips is true, the column looks for a property named label on each data provider item and displays it as its data tip. However, some data providers do not have a label property nor do they have another property that you can use for displaying data in the rows.

For example, you have a data provider that contains a lastName and firstName fields, but you want to display full names as the data tip. You can specify a function to the dataTipFunction property that returns a single String containing the value of both fields. You can also use the dataTipFunction property for handling formatting and localization.

The signature of the dataTipFunction function must match the following:

dataTipFunction(item:Object, column:GridColumn):String
The item parameter is the data provider item for an entire row. The second parameter is this column object.

A typical function might concatenate an item's firstName and lastName properties, or do some custom formatting on a Date value property.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 dataTipFunctionChanged 事件。



實作
    public function get dataTipFunction():Function
    public function set dataTipFunction(value:Function):void

相關 API 元素

editable

屬性 
editable:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Indicates whether the items in the column are editable. If true, and the associated grid's editable property is also true, the items in a column are editable and can be individually edited by clicking on a selected item, or by navigating to the item and pressing the F2 key.

預設值為 true。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 editableChanged 事件。



實作
    public function get editable():Boolean
    public function set editable(value:Boolean):void

formatter

屬性 
formatter:IFormatter

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Specifies the formatter used by the column's itemToLabel() method to convert data provider items to strings.

If the formatter's styleParent was not specified, it's set to the column's grid, so that the formatter inherits the grid's locale style.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 formatterChanged 事件。



實作
    public function get formatter():IFormatter
    public function set formatter(value:IFormatter):void

相關 API 元素

grid

屬性 
grid:Grid  [唯讀]

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The Grid object associated with this column.

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 gridChanged 事件。



實作
    public function get grid():Grid

headerRenderer

屬性 
headerRenderer:IFactory

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The class factory for the IGridItemRenderer class used as the header for this column. If unspecified, the DataGrid controls's columnHeaderGroup skin part defines the default header renderer.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 headerRendererChanged 事件。



實作
    public function get headerRenderer():IFactory
    public function set headerRenderer(value:IFactory):void

相關 API 元素

headerText

屬性 
headerText:String

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Text for the header of this column. By default, the associated grid control uses the value of the dataField property as the header text.

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 headerTextChanged 事件。



實作
    public function get headerText():String
    public function set headerText(value:String):void

imeMode

屬性 
imeMode:String

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Specifies the IME (Input Method Editor) mode. The IME enables users to enter text in Chinese, Japanese, and Korean. Flex sets the specified IME mode when the control gets the focus, and sets it back to the previous value when the control loses the focus.

The flash.system.IMEConversionMode class defines constants for the valid values for this property. You can also specify null to specify no IME.

預設值為 null。



實作
    public function get imeMode():String
    public function set imeMode(value:String):void

相關 API 元素

itemEditor

屬性 
itemEditor:IFactory

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

A class factory for IGridItemEditor class used to edit individual grid cells in this column. If this property is null, and the column grid's owner is a DataGrid control, then the value of the DataGrid control's itemEditor property is used. If no item editor is specified by the DataGrid control, then use the DefaultGridItemEditor class.

The default item editor is the DefaultGridItemEditor class, which lets you edit a simple text field. You can create custom item renderers by creating a subclass of the GridItemEditor class. Your custom item editor can write data to the entire row of the grid to define more complex editor.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 itemEditorChanged 事件。



實作
    public function get itemEditor():IFactory
    public function set itemEditor(value:IFactory):void

相關 API 元素

itemRenderer

屬性 
itemRenderer:IFactory

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The class factory for the IGridItemRenderer class used to render individual grid cells. If not specified, use the value of the itemRenderer property from the associated grid control.

The default item renderer is the DefaultGridItemRenderer class, which displays the data item as text. You can create custom item renderers by creating a subclass of the GridItemRenderer class. Your custom item renderer can access the data from the entire row of the grid to define more complex visual representation of the cell.

The default value is the value of the itemRenderer property from the associated grid control, or null.

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 itemRendererChanged 事件。



實作
    public function get itemRenderer():IFactory
    public function set itemRenderer(value:IFactory):void

相關 API 元素

itemRendererFunction

屬性 
itemRendererFunction:Function

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

If specified, the value of this property must be an idempotent function that returns an item renderer IFactory based on its data provider item and column parameters. Specifying a value to the itemRendererFunction property makes it possible to use more than one item renderer in this column.

The function specified to the itemRendererFunction property must have the following signature:

itemRendererFunction(item:Object, column:GridColumn):IFactory

The item parameter is the data provider item for an entire row. The second parameter is this column object.

Shown below is an example of an item renderer function:

      function myItemRendererFunction(item:Object, column:GridColumn):IFactory
      {
          return (item is Array) ? myArrayItemRenderer : myItemRenderer;
      }
      

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 itemRendererFunctionChanged 事件。



實作
    public function get itemRendererFunction():Function
    public function set itemRendererFunction(value:Function):void

labelFunction

屬性 
labelFunction:Function

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

An idempotent function that converts a data provider item into a column-specific string that's used to initialize the item renderer's label property.

You can use a label function to combine the values of several data provider items into a single string. If specified, this property is used by the itemToLabel() method, which computes the value of each item renderer's label property in this column.

The function specified to the labelFunction property must have the following signature:

labelFunction(item:Object, column:GridColumn):String

The item parameter is the data provider item for an entire row. The second parameter is this column object.

A typical label function could concatenate the firstName and lastName properties of the data provider item , or do some custom formatting on a Date value property.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 labelFunctionChanged 事件。



實作
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void

相關 API 元素

maxWidth

屬性 
maxWidth:Number

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The maximum width of this column in pixels. If specified, the grid's layout makes the column's layout width the smaller of the width of the typicalItem and the maxWidth. If this column is resizable, this property limits how wide the user can make this column. Setting this property does not change the width or minWidth properties.

預設值為 NaN。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 maxWidthChanged 事件。



實作
    public function get maxWidth():Number
    public function set maxWidth(value:Number):void

minWidth

屬性 
minWidth:Number

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The minimum width of this column in pixels. If specified, the grid's layout makes the column's layout width the larger of the width of the typicalItem and the minWidth. If this column is resizable, this property limits how small the user can make this column. Setting this property does not change the width or maxWidth properties.

預設值為 20。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 minWidthChanged 事件。



實作
    public function get minWidth():Number
    public function set minWidth(value:Number):void

rendererIsEditable

屬性 
rendererIsEditable:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Determines whether any of the item renderer's controls are editable. If the column is editable, the focusable controls in the item renderer are given keyboard focus when the user starts editing the item renderer.

When you set this property to true, the cell becomes editable when the user clicks inside of it. Because the cell is editable, the DataGrid displays the editorIndicator skin part, which appears on top of the selectionIndicator skin part. Therefore, the user does not see an indicator for cell selection until the edit session is complete. You can create a custom skin to remove or modify the editorIndicator skin part so that the selectionIndicator skin part appears. For example, you can set alpha property of the editorIndicator to allow the selectionIndicator to show through, or change the size of the editorIndicator so that it is smaller than the cell.

By setting this property to true, you take responsibility for validating and saving input collected by the item renderer. If the item renderer contains an override of the IGridItemRenderer.prepare() method, then you must ensure that unsaved input field changes are not overwritten. For example, rendererIsEditable is true and the renderer contains a single TextInput element that displays the value of data.myDataField. If the renderer's prepare() method sets the TextInput control's text property, then the prepare() method must not set the text property when there are pending changes.

預設值為 false。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 rendererIsEditableChanged 事件。



實作
    public function get rendererIsEditable():Boolean
    public function set rendererIsEditable(value:Boolean):void

resizable

屬性 
resizable:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Indicates whether the user is allowed to resize the width of the column. If true, and the resizableColumns property of the associated grid is also true, the user can drag the grid lines between the column headers to resize the column.

預設值為 true。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 resizableChanged 事件。



實作
    public function get resizable():Boolean
    public function set resizable(value:Boolean):void

showDataTips

屬性 
showDataTips:*

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Indicates whether the datatips are shown in the column. If true, datatips are displayed for text in the rows. Datatips are tooltips designed to show the text that is too long for the row.

If this property's value is undefined, the default, then the associated grid's showDataTips property determines if datatips are shown. If this property is set, the grid's showDataTips property is ignored.

預設值為 undefined。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 showDataTipsChanged 事件。



實作
    public function get showDataTips():*
    public function set showDataTips(value:any):void

相關 API 元素

sortable

屬性 
sortable:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

If true, and if the grid's data provider is an ICollectionView, and if the associated grid's sortableColumns property is true, then this column supports interactive sorting. Typically the column's header handles mouse clicks by setting the data provider's sort property to a Sort object whose SortField is this column's dataField.

If the data provider is not an ICollectionView, then this property has no effect.

預設值為 true。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 sortableChanged 事件。



實作
    public function get sortable():Boolean
    public function set sortable(value:Boolean):void

sortCompareFunction

屬性 
sortCompareFunction:Function

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The function that compares two elements during a sort of on the data elements of this column. If you specify a value of the labelFunction property, you typically also provide a sortCompareFunction.

The sortCompareFunction's signature must match the following:

sortCompareFunction(obj1:Object, obj2:Object, column:GridColumn):int

The function should return a value based on the comparison of the objects:

  • -1 if obj1 should appear before obj2 in ascending order.
  • 0 if obj1 = obj2.
  • 1 if obj1 should appear after obj2 in ascending order.

The function may use the column parameter to write generic compare functions.

Note: The obj1 and obj2 parameters are entire data provider elements and not just the data for the item.

If the dataProvider is not an ICollectionView, then this property has no effect.

預設值為 null。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 sortCompareFunctionChanged 事件。



實作
    public function get sortCompareFunction():Function
    public function set sortCompareFunction(value:Function):void

sortDescending

屬性 
sortDescending:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

If true, this column is sorted in descending order. For example, if the column's dataField contains a numeric value, then the first row would be the one with the largest value for this column.

Setting this property does not start a sort; it only sets the sort direction. When the dataProvider.refresh() method is called, the sort is performed.

If the data provider is not an ICollectionView, then this property has no effect.

預設值為 false。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 sortDescendingChanged 事件。



實作
    public function get sortDescending():Boolean
    public function set sortDescending(value:Boolean):void

sortField

屬性 
sortField:SortField  [唯讀]

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Returns a SortField that can be used to sort a collection by this column's dataField.

If the sortCompareFunction property is defined, then the SortField's compareFunction is automatically set.

If the sortCompareFunction property is not defined and the dataField is complex, then the SortField's compare function is assigned to a closure around a default compare function that handles the complex dataField.

If the sortCompareFunction and dataField properties are not defined, but the labelFunction property is defined, then it assigns the compareFunction to a closure that does a basic string compare on the labelFunction applied to the data objects.



實作
    public function get sortField():SortField

相關 API 元素

visible

屬性 
visible:Boolean

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

If true, then display this column. If false, no space will be allocated for this column; it will not be included in the layout.

預設值為 true。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 visibleChanged 事件。



實作
    public function get visible():Boolean
    public function set visible(value:Boolean):void

width

屬性 
width:Number

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The width of this column in pixels. If specified, the grid's layout ignores its typicalItem property and this column's minWidth and maxWidth properties.

預設值為 NaN。

此屬性可以做為資料繫結的來源。一旦修改此屬性,將傳送 widthChanged 事件。



實作
    public function get width():Number
    public function set width(value:Number):void
建構函式詳細資料

GridColumn

()建構函式
public function GridColumn(columnName:String = null)

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Constructor.

參數
columnName:String (default = null) — Initial value for the dataField and headerText properties.
方法詳細資訊

itemToDataTip

()方法
public function itemToDataTip(item:Object):String

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Convert the specified data provider item to a column-specific datatip String.

This method uses the values dataTipField and dataTipFunction. If those properties are null, it uses the corresponding properties from the associated grid control. If dataTipField properties is also null in the grid control, then use the dataField property.

If dataTipFunction and dataTipFormatter are null, then this method's value is the same as: item[dataTipField].toString(). If dataTipFormatter is specified then this method's value is the same as: dataTipFormatter.format(item[dataTipField]) If resolving the item's dataField causes an error to be thrown, ERROR_TEXT is returned.

If item and dataTipFunction are not null, then this method returns dataTipFunction(item, this), where the second argument is this GridColumn.

參數

item:Object — The value of grid.dataProvider.getItemAt(rowIndex).

傳回值
String — A column-specific string for the specified data provider item or ERROR_TEXT.

itemToLabel

()方法 
public function itemToLabel(item:Object):String

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Convert the specified data provider item to a column-specific String. This method is used to initialize item renderers' label property.

If labelFunction is null, and dataField is a string that does not contain "." field name separator characters, and formatter is null, then this method is equivalent to:

item[dataField].toString()

If the formatter was specified, then this method's value is:

formatter.format(item[dataField])

If dataField is a "." separated path, then this method looks up each successive path element. For example if ="foo.bar.baz", then this method returns a string based on the value of item.foo.bar.baz. If resolving the item's dataField causes an error to be thrown, ERROR_TEXT is returned.

If item and labelFunction are not null, then this method returns labelFunction(item, this), where the second argument is this GridColumn.

參數

item:Object — The value of grid.dataProvider.getItemAt(rowIndex).

傳回值
String — A column-specific string for the specified dataProvider item or ERROR_TEXT.

itemToRenderer

()方法 
public function itemToRenderer(item:Object):IFactory

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

Convert the specified data provider item to a column-specific item renderer factory. By default this method calls the itemRendererFunction if it's non-null, otherwise it just returns the value of the column's itemRenderer property.

參數

item:Object — The value of grid.dataProvider.getItemAt(rowIndex).

傳回值
IFactory — A column-specific item renderer factory for the specified dataProvider item.
常數詳細資訊

ERROR_TEXT

常數
public static const ERROR_TEXT:String = "unknown"

語言版本: ActionScript 3.0
產品版本: Flex 4.5
執行階段版本: Flash Player 10, AIR 2.5

The return value for the itemToLabel() or itemToDataTip() method if resolving the corresponding property name (path) fails. The value of this constant is a single space String: " ".

相關 API 元素

GridColumnExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--

A simple example of a DataGrid with explicitly specified columns.

The DataGrid's columns are specified by an ArrayList (an IList) and can always be accessed as such.  
For example dataGrid.columns.length returns the total number of columns and 
dataGrid.columns.getItemAt(index) returns the GridColumn at the specified index.  The columns list 
is mutable, which means that GridColumns can be added or removed at any time.

Column widths do not depend on the column's headerText, they're based on the rendered widths of 
the DataGrid's typicalItem. If that's not specified, then the first data item is used.  That's the 
case here.  Each column can specify an explicit width and by default all GridColumns are 
resizable="true", which means that the column can be interactively resized by dragging the edges 
between columns.  Interactively resizing column widths changes the DataGrid's measuredWidth which 
can be a little disconcerting if the DataGrid's width is not constrained.  In this example we've 
constrained the DataGrid's left and right edges which prevents changes in the DataGrid's 
measuredWidth from affecting its actual width.

-->

<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark">
    
    <s:Panel title="Spark DataGrid Control Example which demonstrates a simple DataGrid with explicitly specified columns"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        
        <s:DataGrid id="dataGrid" left="5" right="5" top="5" bottom="5">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn dataField="key" headerText="Key"/>
                    <s:GridColumn dataField="name" headerText="Name"/>
                    <s:GridColumn dataField="price" headerText="Price"/>
                    <s:GridColumn dataField="call" headerText="Call"/>
                </s:ArrayList>
            </s:columns>
            
            <s:ArrayCollection>
                <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
                <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
                <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
                <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
                <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
                <s:DataItem key="1005" name="File" price="150.05" call="true"/>
                <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
                <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
                <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
                <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>             
            </s:ArrayCollection>
        </s:DataGrid>    
    </s:Panel>
</s:Application>    
GridColumnVisibilityExample.mxml
<?xml version="1.0" encoding="utf-8"?>

<!--

Demonstrate the GridColumn visible property and the support for dynamically adding and removing columns.

After selecting a column it's visibility can be changed, a copy of the column can be inserted, and the column can be removed.

The DataGrid columns property is a mutable list - an IList, like ArrayList - and columns can be added or removed at any time.  The difference 
between an IList and an intrinsic collection type like Array or Vector is that ILists dispatch events when they're changed.   That's why the
DropDownList, whose dataProvider is the list of columns, tracks the changes made with the Add/Remove buttons.

Changing a column's visibility does not change its presence or position in the columns IList but it prevents the DataGrid from displaying it.

-->

<s:Application 
    xmlns:fx="http://ns.adobe.com/mxml/2009" 
    xmlns:s="library://ns.adobe.com/flex/spark">
    
    <fx:Script>
        <![CDATA[
            // Insert a column to the left of specified column
            private function addNewColumn(column:GridColumn):void
            {
                const newColumn:GridColumn = new GridColumn();
                newColumn.dataField = column.dataField;
                newColumn.headerText = column.headerText + "+";
                dataGrid.columns.addItemAt(newColumn, column.columnIndex);
            }
            
            // Remove the specified column
            private function removeColumn(column:GridColumn):void
            {
                dataGrid.columns.removeItemAt(column.columnIndex);
            }
        ]]>
    </fx:Script>
    
    <s:Panel title="Spark DataGrid Control Example which demonstrates the GridColumn visible property and dynamically adding and removing columns"
             width="75%" height="75%" 
             horizontalCenter="0" verticalCenter="0">
        
        <s:controlBarContent>
            <s:HGroup verticalAlign="baseline">
                <s:DropDownList id="ddl" prompt="Select" dataProvider="{dataGrid.columns}" labelField="headerText"/>
                <s:Label text="Visible:"/>
                <s:CheckBox selected="@{ddl.selectedItem.visible}" enabled="{ddl.selectedItem}"/>
                <s:Button label="Add" click="addNewColumn(ddl.selectedItem)" enabled="{ddl.selectedItem}"/>
                <s:Button label="Remove" click="removeColumn(ddl.selectedItem)" enabled="{ddl.selectedItem}"/>
            </s:HGroup>
        </s:controlBarContent>
        
        <s:DataGrid id="dataGrid" left="5" right="5" top="5" bottom="5">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn dataField="key" headerText="Key"/>
                    <s:GridColumn dataField="name" headerText="Name"/>
                    <s:GridColumn dataField="price" headerText="Price"/>
                    <s:GridColumn dataField="call" headerText="Call"/>
                </s:ArrayList>
            </s:columns>
            
            <s:ArrayCollection>
                <s:DataItem key="1000" name="Abrasive" price="100.11" call="false"/>
                <s:DataItem key="1001" name="Brush" price="110.01" call="true"/>
                <s:DataItem key="1002" name="Clamp" price="120.02" call="false"/>
                <s:DataItem key="1003" name="Drill" price="130.03" call="true"/>
                <s:DataItem key="1004" name="Epoxy" price="140.04" call="false"/>
                <s:DataItem key="1005" name="File" price="150.05" call="true"/>
                <s:DataItem key="1006" name="Gouge" price="160.06" call="false"/>
                <s:DataItem key="1007" name="Hook" price="170.07" call="true"/>
                <s:DataItem key="1008" name="Ink" price="180.08" call="false"/>
                <s:DataItem key="1009" name="Jack" price="190.09" call="true"/>             
            </s:ArrayCollection>
        </s:DataGrid>    
    </s:Panel>    
</s:Application>






[ X ]為什麼顯示英文?
「ActionScript 3.0 參考」的內容是以英文顯示

並非所有「ActionScript 3.0 參考」的內容都翻譯為所有語言。當語言元素未翻譯時,就會以英文顯示。例如,ga.controls.HelpBox 類別並沒有翻譯為任何語言。因此在參考的繁體中文版本中,ga.controls.HelpBox 類別就會以英文顯示。