Hi Sankar,

Dont override the UpdateDisplayList method here. For itemrenderer you
need to overried the set data method and then write your logic there

override public function set data(value:Object):void{
    super.data = value;
    if(value.Gender == "Male"){
        //male icon
    }
    else{
        //female Icon
    }
}

HTH,

-Ravi

On Apr 16, 7:33 pm, sankar swaroop <[email protected]> wrote:
> Hi friends,
>
> i am displaying gender in grid as Male and Female.
> But now i want to display male and female as icons like
> based on the condition if male it needs to display one icon
> and if female another icon should be displayed.
>
> I created itemrenderer to that like below:
>
> *
>
> package*{
>
> **
>
> *import* mx.controls.Image;
>
> *public* *class* GenderIcons *extends* Image
>
> {
>
> **
>
> [*Bindable*]
>
> [*Embed*(source=*'icons/male.png'*)]
>
> *public* *var* male:Class;
>
> [*Bindable*]
>
> [*Embed*(source=*'icons/female.png'*)]
>
> *public* *var* female:Class;
>
> *override* *protected* *function* updateDisplayList(unscaledWidth:Number,
> unscaledHeight:Number):*void
> *
>
> {
>
> *super*.updateDisplayList(unscaledWidth,unscaledHeight);
>
> setStyle(*"icon"*,(da...@gender == *"Male"*)?male:female);
>
> }
> }
> }
>
> But it is not displaying anything. Is there any error in code
>
> Please help me
>
> Thanks in advance
>
> Bye....
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to