Have you set an item renderer for the check box column? Something like the following:
<mx:DataGridColumn dataField="Confirmed"
editable="true"
rendererIsEditor="true"
itemRenderer="mx.controls.CheckBox"
editorDataField="selected"/>
This will bind the value back into your data provider as it is
clicked/selected.
Also, to iterate through your ArrayCollection, you reference it differently
than a regular array as it is likely a collection of objects. You'll
iterate through it with something like :
var i : uint;
var thisItem : YourItemClass;
for( i = 0 ; i < myData.length; i++){
thisItem = YourItemClass( myData.getItemAt(i)
);
}
Hope that helps,
Nate Nielsen
[EMAIL PROTECTED]
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Ramsey, Robert L
Sent: Wednesday, October 31, 2007 9:09 AM
To: [email protected]
Subject: [flexcoders] datagrids and data changes
Hi,
I have the feeling I'm being very stupid about something, but here goes.
I have a datagrid, myDatagrid, bound to a dataprovider, myData. myData
is an ArrayCollection based on an xml list of data returned from a php
script with an httpservice call, but I don't think that should make a
difference.
Right now, the data is one column that is a checkbox. By default, the
checkbox value is set to false.
If I click a checkbox and then iterate through myData, myData doesn't
reflect the change to the data. Some of the things I was reading seemed
to suggest that myData should immediately reflect the changes made to
the data presented by myDatagrid. I'm not sure that should be true
since it was only a one way binding from myData -> myDatagrid.
My ultimate goal is that when the user clicks the submit button, I get
only the records in myDatagrid that have changed. By the time the app
is done there may be hundreds of rows of records with up to 10 fields.
If I have to build the iteration, that's fine, but I'm also not seeing
how to iterate through myDatagrid. Ideally,
myDatagrid[rownumber][columned] would be great, but reading through the
help I can't see what property of the datagrid let's me access the array
of data.
Thanks for any suggestions you can give me!
Bob
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Even a man who is pure in heart
and says his prayers by night
may become a wolf when the wolfbane blooms
and the autumn moon is bright.
Maleva (Maria Ouspenskaya) The Wolf Man
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<<image001.jpg>>
<<image002.jpg>>

