用于 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 的标签
Motion 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

GridColumn 类定义 Spark 网格控件(如 Spark DataGrid 或 Grid 控件)的列。控件的每个数据提供程序项都对应于网格中的一行。GridColumn 类指定数据提供程序项的字段,其值将在列中显示。还指定用于显示该值的项呈示器、用于更改该值的项编辑器以及列的其它属性。

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
[只读] 此列在网格的列列表中的位置;如果此列的网格为 null,则为 -1。
GridColumn
 Inheritedconstructor : Object
对类对象或给定对象实例的构造函数的引用。
Object
  dataField : String
与列关联的数据提供程序项目中字段或属性的名称。
GridColumn
  dataTipField : String
数据提供程序中显示为数据提示的字段名称。
GridColumn
  dataTipFormatter : IFormatter
指定列的 itemToDataTip() 方法用来将数据提供程序项转换为字符串的格式化程序。
GridColumn
  dataTipFunction : Function
指定在数据提供程序每个项目上运行的回调函数,以确定其数据提示。
GridColumn
  editable : Boolean
指示是否能对列中的项目进行编辑。
GridColumn
  formatter : IFormatter
指定列的 itemToLabel() 方法用来将数据提供程序项转换为字符串的格式化程序。
GridColumn
  grid : Grid
[只读] 与此列关联的 Grid 对象。
GridColumn
  headerRenderer : IFactory
用作此列标题的 IGridItemRenderer 类的类工厂。
GridColumn
  headerText : String
此列的标题文本。
GridColumn
  imeMode : String
指定 IME(输入法编辑器)模式。
GridColumn
  itemEditor : IFactory
用于编辑此列中各个网格单元格的 IGridItemEditor 类的类工厂。
GridColumn
  itemRenderer : IFactory
用于呈示各个网格单元格的 IGridItemRenderer 类的类工厂。
GridColumn
  itemRendererFunction : Function
如果已指定,则此属性的值必须为幂函数,该函数根据其数据提供程序项和列参数返回项呈示器 IFactory。
GridColumn
  labelFunction : Function
将数据提供程序项转换为特定于列的字符串的幂函数,该字符串用于初始化项呈示器的 label 属性。
GridColumn
  maxWidth : Number
此列的最大宽度,以像素为单位。
GridColumn
  minWidth : Number
此列的最小宽度,以像素为单位。
GridColumn
  rendererIsEditable : Boolean
确定是否能对项呈示器的任意控件进行编辑。
GridColumn
  resizable : Boolean
指示是否允许用户调整列宽大小。
GridColumn
  showDataTips : *
指示是否在列中显示数据提示。
GridColumn
  sortable : Boolean
如果为 true,网格的数据提供程序为 ICollectionView,且关联网格的 sortableColumns 属性为 ture,则此列支持交互式排序。
GridColumn
  sortCompareFunction : Function
对此列中的数据元素排序时比较两个元素的函数。
GridColumn
  sortDescending : Boolean
如果为 true,则按降序顺序对此列排序。
GridColumn
  sortField : SortField
[只读] 返回 SortField(可用于按此列的 dataField 对集合进行排序)。
GridColumn
  visible : Boolean
如果为 true,则显示此列。
GridColumn
  width : Number
此列的宽度,以像素为单位。
GridColumn
公共方法
 方法由以下参数定义
  
GridColumn(columnName:String = null)
构造函数。
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
  
将指定的数据提供程序项转换为特定于列的数据提示字符串。
GridColumn
  
将指定的数据提供程序项转换为特定于列的字符串。
GridColumn
  
将指定的数据提供程序项转换为特定于列的项呈示器工厂。
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"
[静态] 如果解析相应的属性名称(路径)失败,则为 itemToLabel() 或 itemToDataTip() 方法的返回值。
GridColumn
属性详细信息

columnIndex

属性
columnIndex:int  [只读]

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

此列在网格的列列表中的位置;如果此列的网格为 null,则为 -1。

此属性可用作数据绑定的源。修改此属性后,将调度 columnIndexChanged 事件。



实现
    public function get columnIndex():int

dataField

属性 
dataField:String

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

与列关联的数据提供程序项目中字段或属性的名称。需要对每个 GridColumn 设置此属性或 labelFunction 属性,才可计算项呈示器的可显示文本。如果设置了 dataFieldlabelFunction 属性,则使用 labelFunction 显示数据并使用 dataField 对数据排序。

此属性的值不一定是列标题中显示的 String。此属性只用于访问数据提供程序中的数据。有关详细信息,请参阅 headerText 属性。

如果列或其网格指定 labelFunction,则不使用 dataField。

默认值为 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

数据提供程序中显示为数据提示的字段名称。默认情况下,如果 showDataTipstrue,则关联的网格控件在每个数据提供程序项中查找名为 label 的属性并进行显示。然而,如果数据提供程序不包含 label 属性,则可以设置 dataTipField 属性以指定其它属性名称。例如,在用户查看数据库中包含的一组用户名时,可以将值设置为“FullName”。

GridColumn.dataTipField 的优先级比此属性高。

如果此列或其网格指定了 dataTipFunction 属性的值,则忽略 dataTipField 属性。

默认值为 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

指定列的 itemToDataTip() 方法用来将数据提供程序项转换为字符串的格式化程序。

如果格式化程序的 styleParent 未指定,它将被设置为列的网格,这样格式化程序就可以继承网格的区域设置样式。

默认值为 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

指定在数据提供程序每个项目上运行的回调函数,以确定其数据提示。此属性由 itemToDataTip 方法使用。

默认情况下,如果 showDataTipstrue,则该列在每个数据提供程序项中查找名为 label 的属性,并将其显示为它的数据提示。不过,某些数据提供程序没有 label 属性,也没有其它可用于显示行中数据的属性。

例如,您具有包含 lastName 和 firstName 字段的数据提供程序,但您希望将全名显示为数据提示。可以为 dataTipFunction 属性指定一个函数,该函数返回包含这两个字段值的单个 String。还可以使用 dataTipFunction 属性来处理格式和本地化。

dataTipFunction 函数的签名必须与以下内容相匹配:

dataTipFunction(item:Object, column:GridColumn):String
item 参数为整个行的数据提供程序项。第二个参数是此列对象。

典型的函数可能连接项的 firstName 和 lastName 属性,或对 Date 值属性设置某种自定义格式。

默认值为 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

指示是否能对列中的项目进行编辑。如果为 true,并且关联的网格的 editable 属性也为 true,则列中的项目是可编辑的,且可以通过以下方法编辑单个项目:单击所选项目,或导航到项目并按 F2 键。

默认值为 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

指定列的 itemToLabel() 方法用来将数据提供程序项转换为字符串的格式化程序。

如果格式化程序的 styleParent 未指定,它将被设置为列的网格,这样格式化程序就可以继承网格的区域设置样式。

默认值为 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

与此列关联的 Grid 对象。

此属性可用作数据绑定的源。修改此属性后,将调度 gridChanged 事件。



实现
    public function get grid():Grid

headerRenderer

属性 
headerRenderer:IFactory

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

用作此列标题的 IGridItemRenderer 类的类工厂。如果未指定,则 DataGrid 控件的 columnHeaderGroup 外观部件定义默认标题呈示器。

默认值为 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

此列的标题文本。默认情况下,关联的网格控件使用 dataField 属性的值作为标题文本。

此属性可用作数据绑定的源。修改此属性后,将调度 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

指定 IME(输入法编辑器)模式。IME 使用户能够用中文、日文和韩文输入文本。当控件获得焦点时,Flex 设置指定的 IME 模式;当该控件失去焦点时,则将其设置回为先前的值。

flash.system.IMEConversionMode 类定义此属性的有效值的常量。您还可以指定 null 不指定任何 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

用于编辑此列中各个网格单元格的 IGridItemEditor 类的类工厂。如果此属性为 null,且列网格的所有者为 DataGrid 控件,则使用 DataGrid 控件的 itemEditor 属性的值。如果 DataGrid 控件未指定任何项编辑器,则使用 DefaultGridItemEditor 类。

默认的项编辑器是 DefaultGridItemEditor 类,可用于编辑简单的文本字段。可以通过创建 GridItemEditor 类的子类来创建自定义项呈示器。自定义项编辑器可以在网格的整个行中写入数据,以定义更复杂的编辑器。

默认值为 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

用于呈示各个网格单元格的 IGridItemRenderer 类的类工厂。如果未指定,则使用关联的网格控件的 itemRenderer 属性的值。

默认项呈示器为 DefaultGridItemRenderer 类,它可将数据项显示为文本。可以通过创建 GridItemRenderer 类的子类来创建自定义项呈示器。自定义项呈示器可以访问网格的整个行中的数据,以定义单元格的更复杂视觉表示。

默认值为关联的网格控件的 itemRenderer 属性的值,或为 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

如果已指定,则此属性的值必须为幂函数,该函数根据其数据提供程序项和列参数返回项呈示器 IFactory。为 itemRendererFunction 属性指定值可以在此列中使用多个项呈示器。

itemRendererFunction 属性指定的函数必须具有以下签名:

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

item 参数为整个行的数据提供程序项。第二个参数是此列对象。

项呈示器函数的示例如下所示:

      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

将数据提供程序项转换为特定于列的字符串的幂函数,该字符串用于初始化项呈示器的 label 属性。

可以使用 label 函数将多个数据提供程序项的值合并为单个字符串。如果已指定,此属性由 itemToLabel() 方法使用,该方法计算此列中每个项呈示器的 label 属性的值。

labelFunction 属性指定的函数必须具有以下签名:

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

item 参数为整个行的数据提供程序项。第二个参数是此列对象。

典型的 label 函数可以连接数据提供程序项的 firstName 和 lastName 属性,或对 Date 值属性设置某种自定义格式。

默认值为 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

此列的最大宽度,以像素为单位。如果已指定,网格布局使用 typicalItemmaxWidth 的宽度之间的较小值作为列的布局宽度。如果此列可调整大小,则此属性会限制用户可调整的最大列宽。设置此属性不更改 widthminWidth 属性。

默认值为 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

此列的最小宽度,以像素为单位。如果已指定,网格布局将使用 typicalItemminWidth 的宽度之间的较大值作为列的布局宽度。如果此列可调整大小,则此属性会限制用户可调整的最小列宽。设置此属性不更改 widthmaxWidth 属性。

默认值为 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

确定是否能对项呈示器的任意控件进行编辑。如果列是可编辑的,则当用户开始编辑项呈示器时,项呈示器中的可聚焦控件将聚焦于键盘。

如果将此属性设置为 true,则用户可以通过单击单元格内部来使单元格可编辑。由于单元格可编辑,因此 DataGrid 显示 editorIndicator 外观部件,该外观部件显示在 selectionIndicator 外观部件之上。因此,在完成编辑会话之前,用户无法看到单元格选择的指示符。您可以创建自定义外观来删除或修改 editorIndicator 外观部件,以便显示 selectionIndicator 外观部件。例如,可以设置 editorIndicatoralpha 属性以显示 selectionIndicator,或更改 editorIndicator 的大小使其小于单元格。

如果将此属性设置为 true,则您需要验证和保存由项呈示器收集的输入。如果项呈示器包含 IGridItemRenderer.prepare() 方法的覆盖,则您必须确保不会覆盖未保存的输入字段。例如,rendererIsEditabletrue,且呈示器包含单个 TextInput 元素,该元素显示 data.myDataField 的值。如果呈示器的 prepare() 方法设置 TextInput 控件的 text 属性,则当存在暂挂的更改时,prepare() 方法不得设置 text 属性。

默认值为 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

指示是否允许用户调整列宽大小。如果为 true,且关联网格的 resizableColumns 属性也为 true,则用户可以拖动列标题之间的网格线以调整列大小。

默认值为 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

指示是否在列中显示数据提示。如果为 true,则显示行中文本的数据提示。数据提示是一些工具提示,用于显示对行而言过长的文本。

如果未定义此属性的值(默认情况),则关联网格的 showDataTips 属性决定是否显示数据提示。如果已设置此属性,则忽略网格的 showDataTips 属性。

默认值为 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

如果为 true,网格的数据提供程序为 ICollectionView,且关联网格的 sortableColumns 属性为 true,则此列支持交互式排序。通常,列标题通过将数据提供程序的 sort 属性设置为 Sort 对象(该对象的 SortField 为此列的 dataField)来处理鼠标单击操作。

如果数据提供程序不是 ICollectionView,则此属性不起作用。

默认值为 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

对此列中的数据元素排序时比较两个元素的函数。如果指定 labelFunction 属性的值,通常还提供 sortCompareFunction

sortCompareFunction 的签名必须与以下内容匹配:

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

函数应该基于对象比较结果返回值:

  • 如果按升序顺序 obj1 应出现在 obj2 前面,则返回 -1。
  • 如果 obj1 = obj2,则返回 0。
  • 如果按升序顺序 obj1 应出现在 obj2 后面,则返回 1。

此函数可以使用列参数编写通用的 compare 函数。

注意:obj1obj2 参数是整个数据提供程序元素,而不只是项目数据。

如果 dataProvider 不是 ICollectionView,则此属性不起作用。

默认值为 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

如果为 true,则按降序顺序对此列排序。例如,如果列的 dataField 包含数字值,则包含此列中最大值的行将为第一行。

设置此属性不会开始进行排序;这只是在设置排序方向。在调用 dataProvider.refresh() 方法时,执行排序。

如果数据提供程序不是 ICollectionView,则此属性不起作用。

默认值为 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

返回 SortField(可用于按此列的 dataField 对集合进行排序)。

如果已定义 sortCompareFunction 属性,则自动设置 SortField 的 compareFunction

如果未定义 sortCompareFunction 属性,且 dataField 较复杂,则将 SortField 的 compare 函数指定给封装默认 compare 函数的闭包,以处理复杂的 dataField

如果未定义 sortCompareFunctiondataField 属性,但已定义 labelFunction 属性,则将 compareFunction 指定给一个闭包,以对应用于数据对象的 labelFunction 执行基本字符串比较。



实现
    public function get sortField():SortField

相关 API 元素

visible

属性 
visible:Boolean

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

如果为 true,则显示此列。如果为 flase,则不会为此列分配任何空间;此列不会包含在布局中。

默认值为 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

此列的宽度,以像素为单位。如果已指定,则网格布局将忽略其 typicalItem 属性和此列的 minWidthmaxWidth 属性。

默认值为 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

构造函数。

参数
columnName:String (default = null)dataFieldheaderText 属性的初始值。
方法详细信息

itemToDataTip

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

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

将指定的数据提供程序项转换为特定于列的数据提示字符串。

此方法使用 dataTipFielddataTipFunction 值。如果这些属性为 null,将使用关联的网格控件中对应的属性。如果网格控件中的 dataTipField 属性也是 null,则使用 dataField 属性。

如果 dataTipFunctiondataTipFormatter 为 null,则该方法的值与 item[dataTipField].toString() 的值相同。如果 dataTipFormatter 已指定,则该方法的值与 dataTipFormatter.format(item[dataTipField]) 的值相同。如果解析项的 dataField 时导致引发错误,则将返回 ERROR_TEXT

如果 itemdataTipFunction 都不是 null,则此方法返回 dataTipFunction(item, this),其中第二个参数是此 GridColumn。

参数

item:Objectgrid.dataProvider.getItemAt(rowIndex) 的值。

返回
String — 指定的数据提供程序项的特定于列的字符串或 ERROR_TEXT

itemToLabel

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

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

将指定的数据提供程序项转换为特定于列的字符串。此方法用于初始化项呈示器的 label 属性。

如果 labelFunction 为 null,且 dataField 是一个不包含“.”字段名分隔符的字符串,且格式化程序为 null,则此方法等同于:

item[dataField].toString()

如果格式化程序已指定,则此方法的值为:

formatter.format(item[dataField])

如果 dataField 是以“.”分隔的路径,则此方法查找各个连续的路径元素。例如,如果为 "foo.bar.baz",则此方法基于 item.foo.bar.baz 的值返回一个字符串。如果解析项的 dataField 时导致引发错误,则返回 ERROR_TEXT。

如果 itemlabelFunction 都不是 null,则此方法返回 labelFunction(item, this),其中第二个参数是此 GridColumn。

参数

item:Objectgrid.dataProvider.getItemAt(rowIndex) 的值。

返回
String — 指定的 dataProvider 项的特定于列的字符串或 ERROR_TEXT。

itemToRenderer

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

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

将指定的数据提供程序项转换为特定于列的项呈示器工厂。默认情况下,如果此方法为非 null,它将调用 itemRendererFunction,否则,仅返回列的 itemRenderer 属性的值。

参数

item:Objectgrid.dataProvider.getItemAt(rowIndex) 的值。

返回
IFactory — 指定的 dataProvider 项的特定于列的项呈示器工厂。
常量详细信息

ERROR_TEXT

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

语言版本: ActionScript 3.0
产品版本: Flex 4.5
运行时版本: Flash Player 10, AIR 2.5

如果解析相应的属性名称(路径)失败,则为 itemToLabel()itemToDataTip() 方法的返回值。此常量的值为单个空格字符串:" "

相关 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 类显示为英语。