Packagespark.utils
Classpublic class LabelUtil
InheritanceLabelUtil Inheritance Object

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : Flash Player 10, AIR 1.5

The LabelUtil class is used by components to determine the correct text to display for their renderers or sub-parts.



Public Methods
 MethodDefined By
  
itemToLabel(item:Object, labelField:String = null, labelFunction:Function = null):String
[static] A function used by components that support item renderers to determine the correct text an item renderer should display for a data item.
LabelUtil
Method Detail
itemToLabel()method
public static function itemToLabel(item:Object, labelField:String = null, labelFunction:Function = null):String

Language Version : ActionScript 3.0
Product Version : Flex 4
Runtime Versions : 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

Parameters

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.

Returns
String — A String representation for the data item