Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How does item renderer work? How do we add item renderer at runtime in flex? : adobe flex action script



How does item renderer work? How do we add item renderer at runtime in flex? : adobe flex action scr..

Answer / Mayank Gupta

An ItemRenderer is a custom component that defines the appearance and behavior of an individual data item within a List-based control, such as a List or DataGrid. To create an ItemRenderer for use at runtime in Flex, you need to extend the UIComponent class and then assign it to the itemRenderer property of your List or DataGrid. Here's a simple example:

```actionscript
import mx.controls.listClasses.ItemRenderer;

public class MyItemRenderer extends ItemRenderer {
private var myData:Object;

public function MyItemRenderer() {
super();
}

override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
// Customize the appearance and behavior of your item here
}

public function set data(value:Object):void {
myData = value;
refresh();
}
}

// In your MXML file:
<mx:List id="myList" itemRenderer="MyItemRenderer">
// Other List properties and child components
</mx:List>
```
In this example, a custom ItemRenderer called 'MyItemRenderer' is created to render items in a List. You can assign it to the itemRenderer property of your List or DataGrid.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Adobe Flex Interview Questions

When I add or modify an item in my dataprovider, why does not it show up in my datagrid?

1 Answers  


Difference between flex and flash?

1 Answers  


What is mvc and how do you relate it to flex apps?

1 Answers  


Why is disable auto update method used?

1 Answers  


What is the dynamic keyword used for in flex actionscript?

1 Answers  


How does item renderer work? : adobe flex action script

1 Answers  


Explain how many levels does flash mx support?

1 Answers  


Explain about different types of channels available in blaze ds?

1 Answers  


How do I get access to the j2ee session from my remoteobjects? : adobe flex action script

1 Answers  


How can u access a variable defined in 1 MXML file to another?

1 Answers  


What are the advantages and disadvantages of using flex? And why flex wins over other technologies?

1 Answers  


What is a view cursor?

1 Answers  


Categories