Packagespark.components.supportClasses
Classpublic class MobileGridColumn
InheritanceMobileGridColumn Inheritance flash.events.EventDispatcher

Language Version : ActionScript 3.0
Product Version : Flex 4.11
Runtime Versions : AIR 3.8

This class is experimental, which means it has not been tested or documented as thoroughly as other core Apache Flex classes.

The MobileGridColumn class defines a column to display in a MobileGrid control.

The MobileGridColumn class specifies the characteristics of the column to display, such as the field of the data provider item whose value is to be displayed in the column. MobileGridColumn takes most of its properties from its parent class and adds the following Grid-specific options:

See also

spark.components.MobileGrid


Public Properties
 PropertyDefined By
  dataField : String
The name of the field or property in the data provider item associated with the column.
MobileGridColumn
  headerStyleName : String
Defines the css style name to be used for displaying this column's header label.
MobileGridColumn
  headerText : String
Defines the text to be displayed in the column's header.
MobileGridColumn
  itemRenderer : IFactory
The class factory for the IMobileGridCellRenderer class used to render individual grid cells.
MobileGridColumn
  labelFunction : Function
An user-defined function that converts a data provider item into a column-specific string that's used to initialize the item renderer's label property.
MobileGridColumn
  percentWidth : Number
Specifies the width of this column as a percentage of the grid's width.
MobileGridColumn
  sortable : Boolean
Flag indicating whether a column can be sorted by clicking on its header.
MobileGridColumn
  sortDescending : Boolean
MobileGridColumn
  sortField : SortField
[read-only] Returns a SortField that can be used to sort a collection by this column's dataField.
MobileGridColumn
  styleName : String
The css style name to apply to the renderer.
MobileGridColumn
  textAlign : String
[write-only] Sets the alignment of text renderers.
MobileGridColumn
  width : Number
Set the desired width for this column.
MobileGridColumn
Public Methods
 MethodDefined By
  
MobileGridColumn(target:IEventDispatcher = null)
MobileGridColumn
Property Detail
dataFieldproperty
dataField:String

The name of the field or property in the data provider item associated with the column. Each GridColumn requires this property or the labelFunction property to be set to calculate the displayable text for the item renderer. If the dataField and labelFunction properties are set, the data is displayed using the labelFunction and sorted using the dataField.

If the column or its grid specifies a labelFunction, then the dataField is not used.

The default value is null.


Implementation
    public function get dataField():String
    public function set dataField(value:String):void

See also

headerStyleNameproperty 
headerStyleName:String

Defines the css style name to be used for displaying this column's header label.

Use this property to display the header in a different color or font, or with a different text alignment.

This property can be used as the source for data binding.


Implementation
    public function get headerStyleName():String
    public function set headerStyleName(value:String):void
headerTextproperty 
headerText:String

Defines the text to be displayed in the column's header.

If this property is not set, the header label will use the value of dataField property instead.


Implementation
    public function get headerText():String
    public function set headerText(value:String):void

See also

itemRendererproperty 
itemRenderer:IFactory

The class factory for the IMobileGridCellRenderer class used to render individual grid cells.

The default item renderer is the ItemTextPartRenderer class, which displays the data item as text, optimized for mobile.

You can use also ItemBitmapPartRenderer to display embedded bitmaps, in which case you need to define the iconField or iconFunction

You can also create custom item renderers by deriving any subclass of UIComponent (eg. s:Button) and implementing IMobileGridCellRenderer.

For performance reasons it's preferable that your renderer be written in ActionScript and be as light as possible.


Implementation
    public function get itemRenderer():IFactory
    public function set itemRenderer(value:IFactory):void

See also

labelFunctionproperty 
labelFunction:Function

An user-defined function that converts a data provider item into a column-specific string that's used to initialize the item renderer's label property.

You can use a label function to combine the values of several data provider items into a single string. If specified, this property is used by the itemToLabel() method, which computes the value of each item renderer's label property in this column.

The function specified to the labelFunction property must have the following signature:

labelFunction(item:Object):String

The item parameter is the data provider item for an entire row.

A typical label function could concatenate the firstName and lastName properties of the data provider item , or do some custom formatting on a Date value property.


Implementation
    public function get labelFunction():Function
    public function set labelFunction(value:Function):void
percentWidthproperty 
percentWidth:Number

Specifies the width of this column as a percentage of the grid's width. Allowed values are 0-100. The default value is NaN. If set, this property has precedence over the fixed width property.

MobileGrid will compute the column widths as follows:

The default value is NaN.


Implementation
    public function get percentWidth():Number
    public function set percentWidth(value:Number):void
sortableproperty 
sortable:Boolean

Flag indicating whether a column can be sorted by clicking on its header.

This flag is effective only if the MobileGrid sortableColumn is not set or set to true.


Implementation
    public function get sortable():Boolean
    public function set sortable(value:Boolean):void
sortDescendingproperty 
sortDescending:Boolean


Implementation
    public function get sortDescending():Boolean
    public function set sortDescending(value:Boolean):void
sortFieldproperty 
sortField:SortField  [read-only]

Returns a SortField that can be used to sort a collection by this column's dataField.

If the dataField properties are not defined, but the labelFunction property is defined, then it assigns the compareFunction to a closure that does a basic string compare on the labelFunction applied to the data objects.


Implementation
    public function get sortField():SortField
styleNameproperty 
styleName:String

The css style name to apply to the renderer.

The style items in the css entry will depend on the renderer. For example, text renderers will accept fontSize, color, fontWeight, etc.


Implementation
    public function get styleName():String
    public function set styleName(value:String):void
textAlignproperty 
textAlign:String  [write-only]

Sets the alignment of text renderers. This property is ignored for non-text renderers.


Implementation
    public function set textAlign(value:String):void
widthproperty 
width:Number

Set the desired width for this column.

Width value is expressed in current applicationDPI, or at 160 DPI if applicationDPI is not set.

Note: You can specify a percentage value in the MXML width attribute, such as width="50%", but you cannot use a percentage value in the width property in ActionScript. Use the percentWidth property instead.

The default value is 100.


Implementation
    public function get width():Number
    public function set width(value:Number):void

See also

Constructor Detail
MobileGridColumn()Constructor
public function MobileGridColumn(target:IEventDispatcher = null)



Parameters
target:IEventDispatcher (default = null)