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
-
When I drag an image to icon URL, such as for Amazon to the dock, changes the image to an image any ordinary of the world. How can I change this image to the original Amazon icon image that existed before I moved to the docking station?
Why do you want to put the URL in the Dock, which doesn't seem like the appropriate place for this.
-
How can I change windows 7 back to the original appearance of the classic?
How can I change windows 7 back to the original appearance of the classic?
Hello
I see what you mean - try the following.
Open windows control panel, open ease of access Center and click on make the mouse easier to use. In the next window, under the heading "Make it easier to manage windows", uncheck the box "Activate a window by hovering over it with the mouse", then click apply and then click Ok.
Kind regards
DP - K
-
How can I change outlook settings to display the field 'to', so that I can see that the emails were sent at a glance?
Outlook:
http://answers.Microsoft.com/en-us/Office/default.aspx
Office at the above link forums
http://answers.Microsoft.com/en-us/Office/ee861097.aspx
Outlook Help Forums at the link above.
They will help you with your Outlook questions when repost you in the Office Forums above.
See you soon.
Mick Murphy - Microsoft partner
-
Windows 7 network connection status sent/received packets in bytes by default. How can I change this setting so that the status is displayed in MBs.
Hey Muhammad,
Thanks for posting the query on Microsoft Community.
Design/default it appears in bytes not in MB.
In the future, if you have problems with Windows, get back to us. We will be happy to help you.
-
How can I change my Premiere Pro to the English version?
How can I change my Premiere Pro to the English version?
Hi Leong,
Please see: -.
FAQ: How can I change the language that appears in my creative cloud app?
-
How can I change my email address on the mail of verification of creative cloud?
How can I change my email address on the mail of verification of creative cloud?
This is a very old post, email verification issues can be sorted by contacting Adobe.
Concerning
Stéphane
-
How can I change my artists contributing and the title of my music files
Hello, some of my music has incorrect artists and titles in its properties, I was wondering how I could change them by typing in the most appropriate? Thank you
HI - regarding the Michel which is not the best way to do it, especially if you use Windows Media Player. Change the information in the Windows Media Library as shown in the screenshot below - highlight and right click and you should get the option 'Edit' for the relevant column. (Modification of information in the library 'explorer' can break the bond of WMP so the change should be made in the library of WMP or alternatively to the location of the original file)
You can highlight the right click and change in the fields in yellow... (and also change the album art if necessary, by selecting a new jpeg image, by clicking on "copy" and you will then get the option "Paste" when you click on the existing image... Note, you will not see 'stick' after clicking 'copy'!) Hope this helps - R
-
How can I change a URL to include the parent page?
How can I change the URL to include the parent Muse page?
for example my URL is www.splinterd.com/kauri.html and I need to be www.splinterd.com/store/kauri.html
I have the page of kauri sitting under store (such as a child page) Muse page.
I have an online marketing person asking it is set like this to help with google rankings / SEO.
Thank you!
Hello mariac,.
This can actually be set up by your FTP host.
Please go to them like asking the necessary changes to the file system of your web site.
Thank you
Ankush
-
How can I change my account information of the French into English?
All of a sudden my account information (Creative Cloud CS6) is in French instead of English. How can I change to English? I need to update my credit card information.
Really frustrated...
Hello
You can change the language settings. See change the language setting of your Cloud Creative applications
For credit card information. you will need to contact support by calling/chat for this request.
* Be sure to stay connected with your Adobe ID before accessing the link above *.
Kind regards
Sheena
-
How can I change an image from gif to jpeg?
How do I change a .gif in jpeg image (line drawing), so I can print it. Also why it would go to media player instead of my photo gallery?
A gif opens in Media Player because the gif files are usually lively and the average, Manager of photos photo editing software can't handle them.
You should do is to open the gif file in Windows Paint and then she re - save in jpeg format...
-
How can we change artboard rectangle programmatically by?
Hello
I want to change the values left, top, right and bottom of the rectangle work plan.
I found the API () AIDocumentSuite::SetDocumentCropBox and play it as below
AIRealRect cropBox = {0, 850, 1700, 0}; left, right, up, down
error = sAIDocument-> SetDocumentRulerUnits (kCentimetersUnits);
error = sAIDocument-> SetDocumentCropBox (& cropBox);
error = sAIDocument-> RedrawDocument ();
After that, the document will appear as in the file ArtBoard.jpg (attached here).
Thus, this .jpg files which Im guessing is, a new art is created instead of change values already present work plan.
I don't want to create a new work plan, I just need to change the values of work plan rectangle. How can I do this?
Another option is to use the AICropAreaSuite (AICropArea.h). This will work best if you are looking to modify a plan of work among many others in CS4. This should work if there is a work plan or many work plans. Simply call AICropAreaSuite::Get() and who will get "properties" the nth work plan, which is an AIRealRect. Then call AICropAreaSuite::Update() when you are finished.
Properties AICropAreaPtr = 0;
sCropArea-> Get (i, & properties);
change the properties-> m_CropAreaRect
sCropArea-> update (i, properties);
-
How can I get an image to stretch the length of my website being seen on the screens?
Here is an example of my site im working on HERE I would like for the image on the landing page range from edge on board as needed when viewed on large screens. I know it's possible because it's done here I don't know how to do it PLEASE HELP.
To achieve a similar effect, simply use the Rectangle tool to create a bar that if grip-to-fit horizontally the box browser in design mode. Then use fill options to insert a picture in the rectangle; You can also change the mount option to scale the horizontal fill or tile/mosaic. See the following screenshot.
Thank you
Vinayak
-
How can you save 2 images exprted of the Organizer in Photoshop format?
Hello
I selected 2 images from the organizer and switching in the editor. When I save the file and then reopen it later, only 1 of the images appear in the photo tray. How to stay there? Thank youYou can leave it open in the image editor. You must select both again in the Organizer.
If you do not close in the editor, you will see a red bar on the thumbnail of the Organizer "Edit in progress"
-
How can I change windows XP Mode of the Chinese version English version?
I have a windows XP Mode in my windows7. It is an English version. How can I do to support the Chinese language?
Thank you.
You need to download and install the language pack on your computer, to do this, follow the steps mentioned in the link below
For more information, see the link below
Install and use Windows XP Mode in Windows 7
http://Windows.Microsoft.com/en-us/Windows7/install-and-use-Windows-XP-mode-in-Windows-7
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