while creating custom item renderers which interfaces we need to implement? Thank in 开发者_开发技巧advance.
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
You should extends class ItemRenderer. If you really want to implement an interface, IItemRenderer only should be enough.
精彩评论