| 包 | mx.olap |
| 类 | public class OLAPAttribute |
| 继承 | OLAPAttribute OLAPHierarchy OLAPElement Proxy Object |
| 实现 | IOLAPAttribute |
隐藏 MXML 语法
The <mx:OLAPAttribute> tag inherits all of the tag attributes
of its superclass, and adds the following tag attributes:
<mx:OLAPAttribute
Properties
dataField=""
/>
另请参见
| 属性 | 定义方 | ||
|---|---|---|---|
![]() | children : IList [只读 (read-only)] 所有成员的子级别,作为 IOLAPMember 实例列表。 | OLAPHierarchy | |
![]() | constructor : Object
对类对象或给定对象实例的构造函数的引用。 | Object | |
| dataCompareFunction : Function 用户提供的回调函数,可用于在排序数据时比较数据元素。 | OLAPAttribute | ||
| dataField : String [只读 (read-only)] 为此 OLAPAttribute 实例提供数据的输入数据集的字段。 | OLAPAttribute | ||
| dataFunction : Function 返回该属性的实际数据的回调函数。 | OLAPAttribute | ||
![]() | defaultMember : IOLAPMember [只读 (read-only)] 层次结构的默认成员。 | OLAPHierarchy | |
![]() | dimension : IOLAPDimension 此元素所属的维度。 | OLAPElement | |
![]() | displayName : String OLAP 元素的名称,可作为 String 显示。 | OLAPElement | |
| displayNameFunction : Function 返回成员元素的显示名称的回调函数。 | OLAPAttribute | ||
| hasAll : Boolean 因为假定属性可聚合并且所有成员都存在,所以包含 true。 | OLAPAttribute | ||
| members : IList [只读 (read-only)] 属于此层次结构的所有级别的所有成员,作为 IOLAPMember 实例列表。 | OLAPAttribute | ||
![]() | name : String 用户定义的此层次结构的名称。 | OLAPHierarchy | |
![]() | prototype : Object [静态]
对类或函数对象的原型对象的引用。 | Object | |
![]() | uniqueName : String [只读 (read-only)] 多维数据集中 OLAP 元素的唯一名称。 | OLAPElement | |
| 方法 | 定义方 | ||
|---|---|---|---|
构造函数。 | OLAPAttribute | ||
![]() | 返回层次结构中具有给定名称的级别。 | OLAPHierarchy | |
![]() | 返回层次结构中具有给定名称的成员。 | OLAPHierarchy | |
![]() |
指示对象是否已经定义了指定的属性。 | Object | |
![]() |
指示 Object 类的实例是否在指定为参数的对象的原型链中。 | Object | |
![]() |
指示指定的属性是否存在、是否可枚举。 | Object | |
![]() |
设置循环操作动态属性的可用性。 | Object | |
![]() | 返回该元素的唯一名称。 | OLAPElement | |
![]() |
返回指定对象的原始值。 | Object | |
| dataCompareFunction | 属性 |
public var dataCompareFunction:Function用户提供的回调函数,可用于在排序数据时比较数据元素。默认情况下,会直接比较数据成员。
| dataField | 属性 |
dataField:String [只读 (read-only)] 为此 OLAPAttribute 实例提供数据的输入数据集的字段。
public function get dataField():String| dataFunction | 属性 |
dataFunction:Function [读写] 返回该属性的实际数据的回调函数。使用此回调函数返回基于实际数据计算的数据。例如,您可以从将该月显示为数字的实际日期作为 String 返回月名称。或者可以计算值。例如,您的输入数据包含人们的年龄,如 1、4、9、10、12、15 或 20。您的回调函数可以返回包含年龄的年龄组,如 1-10 或 11-20。
回调函数的签名为:
function myDataFunction(rowData:Object, dataField:String):Object;其中
rowData 包含输入平构数据行的数据,dataField 包含数据字段的名称。
该函数可以返回 String 或 Number。
下例返回了该平构数据中每个年龄值的年龄组:
private function ageGroupingHandler(rowData:Object, field:String):Object
{
return rowData[field] / 10;
}
public function get dataFunction():Function public function set dataFunction(value:Function):void| displayNameFunction | 属性 |
public var displayNameFunction:Function返回成员元素的显示名称的回调函数。Flex 会为添加到 OLAPAttribute 实例的每个成员调用此函数。
函数签名为:
function myDisplayNameFunction(memberName:String):String
其中 memberName 包含元素名称。
返回元素的显示名称的函数。
下例将数字组名称 1,2 或 3 等转换为显示名称“0-9”、“10-19”:
private function myDispFunction(name:String):String
{
var value:int = parseInt(name);
return String((value)0 + " - ") + String((value+1)0-1);
}
| hasAll | 属性 |
hasAll:Boolean [读写]
因为假定属性可聚合并且所有成员都存在,所以包含 true。
public function get hasAll():Boolean public function set hasAll(value:Boolean):void| members | 属性 |
members:IList [只读 (read-only)] 属于此层次结构的所有级别的所有成员,作为 IOLAPMember 实例列表。返回的列表可能表示远程数据,因此可以引发 ItemPendingError。
public function get members():IList| OLAPAttribute | () | 构造函数 |
public function OLAPAttribute(name:String = null, displayName:String = null)构造函数。
参数name:String (default = null) — OLAPAttribute 实例的名称。使用此参数将 OLAPAttribute 实例与 OLAPLevel 实例关联起来。 | |
displayName:String (default = null) — 属性的名称,可以作为 String 显示。 |