<mx:tagname headerHeight="depends on styles and header renderer" showHeaders="true|false" />]]>
此方法为公用方法,因此可供 DataGridHeader 类访问,主要应用于 DataGrid 控件的子类。
尽管此类的属性是可写的,但应将其视为只读。它们由 DataGrid 类进行初始化,并由项呈示器或项目编辑器读取。更改这些值可能导致意外结果。
<mx.DataGridColumn>
tag to configure a column
of a DataGrid control.
You specify the <mx.DataGridColumn>
tag as a child
of the columns property in MXML.
The <mx.DataGridColumn>
tag inherits all of the
tag attributes of its superclass, and adds the following tag attributes:
<mx:DataGridColumn Properties dataField="No default" dataTipField="No default" dataTipFunction="No default" editable="true|false" editorDataField="text" editorHeightOffset="0" editorUsesEnterKey="false|true" editorWidthOffset="0" editorXOffset="0" editorYOffset="0" headerRenderer="DataGridItemRenderer" headerText="No default" headerWordWrap="undefined" imeMode="null" itemEditor="TextInput" itemRenderer="DataGridItemRenderer" labelFunction="No default" minWidth="20" rendererIsEditor="false|true" resizable="true|false" showDataTips="false|true" sortable="true|false" sortCompareFunction="No default" sortDescending="false|true" visible="true|false" width="100" wordWrap="false|true" Styles backgroundColor="0xFFFFFF" color="No default." disabledColor="0xAAB3B3" fontAntiAliasType="advanced" fontFamily="No default" fontGridFitType="pixel" fontSharpness="0" fontSize="No default" fontStyle="normal|italic" fontThickness="0" fontWeight="normal|bold" headerStyleName="No default" paddingLeft="0" paddingRight="0" textAlign="right|center|left" textDecoration="none|underline" textIndent="0" />]]>
注意:
此方法供创建 DataGridColumn 类的子类的开发人员使用。它不适用于应用程序开发人员。
设置此属性不会开始进行排序;这只是在设置排序方向。单击列标题执行排序。
此属性的值不一定是列标题中显示的 String。此属性只用于访问数据提供程序中的数据。有关详细信息,请参阅
默认情况下,该控件将在每个数据提供程序项目上查找名为
此函数必须采用一个 Object 参数(包含数据提供程序元素)并返回一个 String。
默认项呈示器为 DataGridItemRenderer 类,用于将项目数据显示为文本。
默认值为空,在这种情况下,它将使用 DataGrid 控件的
默认项呈示器为 DataGridItemRenderer 类,用于将项目数据显示为文本。
对于 DataGrid 控件,方法签名具有以下格式:
labelFunction(item:Object, column:DataGridColumn):String
其中,
回调函数可能会连接数据中的 firstName 和 lastName 字段,或者对 Date 设置某些自定义格式,也可能将月的数字形式转换为字符串形式。
默认项呈示器为 DataGridItemRenderer 类,用于将项目数据显示为文本。
DataGrid 控件使用此函数对数据提供程序集合的元素排序。回调函数的函数签名采用两个参数并具有以下格式:
mySortCompareFunction(obj1:Object, obj2:Object):int
函数应该基于对象比较结果返回值:
注意:
仅当
通过创建自定义的项呈示器,您可以覆盖默认项呈示器。
当您使用组件作为项呈示器时,