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

What is shared object? (Or) how to store the data in local?

1 Answers  


I have I input text field on stage and I have a button also, further I am writing some text in that input text field. I want to save my written data on my local system (onmy computer), how can I do this? : adobe flex action script

1 Answers  


If I purchase flex builder 2, am I eligible for an upgrade to flex builder 3?

1 Answers  


What are sealed classes in flex?

1 Answers  


Can I still purchase flex charting?

0 Answers  


Why is mytreenode.label or mytreenode.attributes.label undefined? : adobe flex action script

1 Answers  


What are the similarities between java and flex?

1 Answers  


Can I resize the internet explorer browser window from flex?

1 Answers  


How do we call javascript from flex actionscript? : adobe flex action script

1 Answers  


How do you generate random numbers within a given limit with actionscript? : adobe flex action script

1 Answers  


Explain what is the function of trace? : adobe flex action script

1 Answers  


What are the 2 ways to compile flex source file?

1 Answers  


Categories