Access between list and itemrenderer project Renderer neutron objects in flex4

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.