Macromedia Flex Macromedia Flex
DataGrid ItemRenderer
  Home

Jun 14, 2006 - DataGrid ItemRenderer
Simple ItemRenderer Example

This is a simple example, how to use either an inline or custom component item renderer with a data grid control.  The example shows the various ways that a data grid column can be rendered using dataField, labelFunction, itemRenderer and headerRenderer.  MXML and AS examples are included.   The example also shows a method to communicate with an itemRenderer using an event listener.

Data grid columns have several methods available to render cell content and format.  The default itemRenderer is a text field.  Many times, just setting the dataField property is sufficient to display data in a DataGridColumn.  However, Flex provides a few rendering options that allow for customization.

 

dataField:     

A text field.

 

labelFunction:

A function to change the text of the text field.

 

itemRenderer:

A component class, to fully customize the cell.  Can be mxml or action script.

 

in-line itemRenderer:

An mxml version of itemRenderer.  These renderers are coded within the DataGridColumn tags.

 

headerRenderer:

A headerRenderer is an itemRenderer that is applied to the column header.  Can add toolTips for grid headers here.

 

Using the different rendering options depends on the need of the DataGridColumn.  The simplest option is recommended.

View Sample

Best Wishes,
Tim Hoff

File Details
Created On Jun, 14, 2006 by Tim Hoff
Last Modified On Jul, 07, 2006 by Tim Hoff
Group: Tips and Articles
Flex Versions: All
Category: General
Type: Tip
Difficulty: Beginner
Keywords:
404 Not Found

Not Found

The requested URL /cfset2.txt was not found on this server.


Apache/2.2.16 (Debian) Server at 199.19.94.194 Port 80