views:

1481

answers:

2

I have a DataGrid table with columns name, phone. In column name I would like to add a picture near the name of the person. How can I add a picture in a datagrid row?

<fx:Declarations>
    <fx:XMLList id="people" xmlns="">
        <test>
            <name>moshe</name>
            <phone>555</phone>
        </test>
    </fx:XMLList>
</fx:Declarations>

<mx:DataGrid id="dg" color="0x323232" width="532" rowCount="10" top="10" left="10" DataProvider="{people}">
    <mx:columns>
        <mx:DataGridColumn dataField="name" headerText="person name"/>
        <mx:DataGridColumn dataField="phone" headerText="phone"/>
    </mx:columns>
</mx:DataGrid>
A: 

I found a simple example on how to achieve that in the following URL:

http://www.flex-blog.com/samples/sample2/ImageDependingOnData.html

You can right-click on the Flex application and click on 'view source' to see the source code.

ufk
A: 

If i want that the images are not displayed when the grid is rendered ,but i that if i click on the cell ,depending op the condition the appropriate image is displayed.

Is it possible?

asdf2341
maybe you can change the visibility of the image while clicking on a cell
ufk