Try something like (foo contains 'pdf' or 'word'):
<mx:Script>
import mx.controls.Image
private function addGif(o, c)
{
return o.foo + ".gif"
}
<mx:DataGridColumn labelFunction="addGif" itemRenderer="Image" />
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Vinoth Babu
Sent: Tuesday, April 03, 2007 8:05 PM
To: [email protected]
Subject: Re: [flexcoders] Re: Need to different images in datagrid
column
Thanks for your info .
But I need to load images according to the data.
for e.g.
In a column , if a data is 'pdf' then load 'pdf.gif' or if it's 'word'
load 'word.gif'
pdf.gif or word.gif or... are shown in one column in a different row
each
Thanks ,
Vinoth
Jack OMelia <[EMAIL PROTECTED]> wrote:
Try using an itemRenderer.
Create a separate component that looks like this:
(saved as imageRenderer.mxml in the comps directory)
<?xml version="1.0" encoding="utf-8"?>
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml
<http://www.adobe.com/2006/mxml> "
paddingBottom="0" paddingLeft="0" paddingRight="0"
paddingTop="2"
width="50" height="20" horizontalAlign="center" >
<mx:Image source="images/image.gif" width="14" height="14" />
</mx:HBox>
then add it to your datagrid like this:
<mx:DataGridColumn headerText="!"
itemRenderer="comps.imageRenderer" />
HTH, Jack
--- In [email protected]
<mailto:flexcoders%40yahoogroups.com> , Vinoth Babu <[EMAIL PROTECTED]>
wrote:
>
> Hi,
>
> Need your help to load an different images in a datagrid
column
>
> Thanks
> Vinoth
>
>
>
> ---------------------------------
> Don't be flakey. Get Yahoo! Mail for Mobile and
> always stay connected to friends.
>
________________________________
Never miss an email again!
Yahoo! Toolbar
<http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar
/features/mail/> alerts you the instant new Mail arrives. Check it out.
<http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolbar
/features/mail/>