How can we change an image programmatically in the DataGrid cell

I have a DataGrid that contains a status icon. I was able to get the initial to display in the DataGrid control status icon. But I'm unable to update the computer. Basically, I need to update the image of a selected line with a "assets/processing.png", ' assets/success.png' or ' assets/failure.png' image. I can't seem to be able to find a way to access the image in the cell need to update/replace it. I tried to give him a property from my collection ArrayCollection data provider, but it does not work. I also tried some how to get a reference to the original image, so it can be replaced, but can not understand how to do such. Here is the code for my DataGrid. I'll be very grateful for any help in this. (I'm relatively new on Flex/ActionScript, but a developer experienced otherwise).

<mx:DataGrid id="myDataGrid" left="0" top="0" bottom="0" right="0"
                     allowMultipleSelection="true" verticalScrollPolicy="on"
                     draggableColumns="false" resizableColumns="false" sortableColumns="false"
                     dataProvider="{myArrayCollection}">
            <mx:columns>
                <mx:DataGridColumn headerText="Name" dataField="name" wordWrap="true" />
                <mx:DataGridColumn headerText="Status" dataField="status" width="75" textAlign="center">
                    <mx:itemRenderer>
                        <mx:Component id="statusComponent">
                            <mx:HBox id="imageBox" width="100%" height="100%" horizontalAlign="center">
                                <mx:Image id="statusImage" source="@Embed('assets/pending.png')" width="16" height="16"  />
                            </mx:HBox>
                        </mx:Component>
                    </mx:itemRenderer>
                </mx:DataGridColumn>
            </mx:columns>
        </mx:DataGrid>

The image must be a property of the arrayCollection collection.  You can either save the image url as a property of type string, or if you must nest, then you can create an actionscript for each image object in a script (private var image1:Image = Image(); image1.source=@embed...)

Then, in the code that processes the event that causes the image must change, replace the image property of the collection arrayCollection member (s) concerned. Then, at the end of the code for the event, trigger the DataGrid to update using the method myDataGrid.invalidateList ();

Mark

Tags: Flex

Similar Questions

Maybe you are looking for

  • Re: Toshiba & DVD Lightscribe media

    * TOSHIBA & DVD LIGHTSCRIBE MEDIA *.I heard that Toshiba does not introduce DVD Lightscribe software (to customize the cd/DVD virgins) as OEM software. Is there a way I could get it on my series of satellite P without having to buy an external hard d

  • Satellite L755-192: generic access i/o and memory driver

    I need help with the ACPI\QCI0701 driverI can't found my laptop L755-192 in your bases! Why? And I can not use this post http://forums.computers.Toshiba-Europe.com/forums/message.jspa?MessageID=190545Because I can't find my cell phone in the download

  • Why not all orders back in windows xp?

    Why not all orders back in windows xp?

  • missing or corrupted ntfs.sys file

    I get a message that my ntfs.sys file is missing or damaged.  It tells me to insert the original installation cd, however, I don't have the original installation cd.  What can I do to restore this file and my computer?

  • PowerConnect 6248P 10 G SFP + compatibility

    Hello Is could someone please tell me if this device is compatible with 6248Ps after adding a module of 10 G uplink for the back? Thanks in advance Peter