October 15, 2010 at 5:26 PM
The base class for Spark item renderers, ItemRenderer, has built in support for all user interactions. The default item renderers, DefaulItemRenderer and DefaultComplexItemRenderer, support these user interactions. Each list control has a default mechanism for controlling the display of data, or view, and lets you override that default.
Add itemrendrer at run time: Very first you will create a basic item renderer. Now i have to know that the item renderer does not renderer in the same datafield because it will easily understand what column it was bound to so I could get and display the correct data. To do this the renderer needs to implement the IDropInListItemRenderer. This interface allows the renderer to have access to information about the list and column it is in via the BaseListData and DataGridListData classes. The DataGridListData gives you everything you need to get the data required to make a flexible, reusable renderer. To Modify itemrenderer at runtime we Need to use mx.core.ClassFactory. Basically, in order to change a Flex itemRenderer at runtime, you need to cast it to a type ClassFactory.