views:

12

answers:

1

Hi,

How can I access the specific .data (based on its dataField) inside an AdvancedDatagridColumn-ItemRenderer instead retrieving the whole data for the parent AdvancedDataGrids dataprovider?

Any idea?

Many thanks...

A: 

In an itemRenderer, your dataProvider's object is passed in to the data property of the itemRenderer. Your itemRenderer will need to implement the IDataRenderer interface

http://livedocs.adobe.com/flex/3/langref/mx/core/IDataRenderer.html

Most Flex Framework Components already implement this interface.

The way that the DataGrid component works internally is to call an itemToLabel function ( http://livedocs.adobe.com/flex/3/langref/mx/controls/listClasses/AdvancedListBase.html#itemToLabel() ) to figure out the label to display. This function will look at the dataField and dateFunction and return a string representing your item.

The results of this function are passed into the itemRenderer as part of the AdvancedDataGridListData class. Take a look at the label property:

http://livedocs.adobe.com/livecycle/8.2/programLC/common/langref/mx/controls/advancedDataGridClasses/AdvancedDataGridListData.html

You can also use DataGridListData.owner to access the dataField directly, although that would be an unusual approach.

www.Flextras.com