What is itemrenderer?
Itemrenderer can be understood as the data representation. Specifically, it refers to the form used to display each piece of data. When using data processing components, we only need to organize the data according to a certain format, and then assign it to the components, so there is no need to worry about the rest.
Each component has a default itemrenderer, such as the list component:
The default itemrenderer of the list component is similar to the label component. Only one line of text is displayed. As shown in the right figure, the red box selects an itemrenderer.
Essentially, itemrenderer is no different from other container components. It can contain any visual elements, including text, images, and videos. It can be any visual element supported by Flex.
Customize itemrenderer
The default itemrenderer of a component is too simple. To enhance the expressiveness, you must create a personalized itemrenderer.
There are two ways to customize itemrenderer: one is embedded, directly written in the tag of the component, allCodeAll are concentrated in one mxml file; the other is to separate itemrenderer to form an mxml component or an ActionScript class.
Itemrenderer can easily present data, but sometimes we need to access the data between the component and itemrenderer. What should we do? Find the following methods:
1. List can access the following itemrenderer by using the member object "assumroup", for example, userlist. Role roup. getchildat (ii) As itemrenderer. Note that you must wait until the list is initialized. Otherwise, userlist. Role roup. numchildren will be 0.
2. In itemrenderer, the owner object is used to access the list.
3. You can send events on the Internet. For more information, see Article http://www.cnblogs.com/aierong/archive/2009/02/11/itemrenderer.html.