Kishor Kumar
Kishor Kumar

Reputation: 543

Creating custom Item renderers in Flex

while creating custom item renderers which interfaces we need to implement? Thank in advance.

Upvotes: 0

Views: 818

Answers (2)

Daniel Hollinrake
Daniel Hollinrake

Reputation: 1778

It all depends on what you want your Item Renderer to do.

            <mx:DataGridColumn
                color="0x00000"
                fontSize="14"
                headerText="Campaign Name" 
                headerStyleName="headerStyle" 
itemRenderer="com.view.components.itemrenderers.SimpleCampaignNameItemRenderer"/>

The above bit of code shows that I want items in a DataGridColumn to be rendered using a custom item renderer I wrote.

The actual renderer itself is a VBox with a LinkButton.

I've had a look through some of my old projects. Nearly all of my item renderers are MXML files. But on one of the AS files, I found this:

public class PhotoRenderer extends UIComponent implements IDataRenderer

Have a look at the Adobe website though, there should be a reasonable tutorial. I'll have a look and post one for you in the next few minutes.

Hope this link helps:

http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_8.html

Upvotes: 1

Harry Ninh
Harry Ninh

Reputation: 16718

You should extends class ItemRenderer. If you really want to implement an interface, IItemRenderer only should be enough.

Upvotes: 0

Related Questions