套件 | spark.utils |
類別 | public class LabelUtil |
繼承 | LabelUtil Object |
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
公用方法
方法 | 定義自 | ||
---|---|---|---|
指出物件是否有已定義的指定屬性。 | Object | ||
指出 Object 類別的實體是否位於指定為參數的物件原型鏈中。 | Object | ||
[靜態]
A function used by components that support item renderers
to determine the correct text an item renderer should display for a data item. | LabelUtil | ||
指出指定的屬性是否存在,以及是否可列舉。 | Object | ||
為迴圈作業設定動態屬性的可用性。 | Object | ||
傳回代表此物件的字串,根據地區特定慣例進行格式化。 | Object | ||
會傳回指定之物件的字串形式。 | Object | ||
會傳回指定之物件的基本值。 | Object |
方法詳細資訊
itemToLabel | () | 方法 |
public static function itemToLabel(item:Object, labelField:String = null, labelFunction:Function = null):String
語言版本: | ActionScript 3.0 |
產品版本: | Flex 4 |
執行階段版本: | Flash Player 10, AIR 1.5 |
A function used by components that support item renderers
to determine the correct text an item renderer should display for a data item.
If no labelField
or labelFunction
parameter
is specified, the toString()
method of the data item
is called to return a String representation of the data item.
The labelFunction
property takes a reference to a function.
The function takes a single argument which is the item in
the data provider and returns a String:
myLabelFunction(item:Object):String
參數
item:Object — The data item. Null items return the empty string.
| |
labelField:String (default = null ) — The field in the data item to return. If labelField is set
to an empty string (""), no field will be considered on the data item
to represent label.
| |
labelFunction:Function (default = null ) — A function that takes the data item
as a single parameter and returns a String.
|
String — A String representation for the data item
|
Tue Jun 12 2018, 03:47 PM Z