Probably that's because the dataGrid is sorting its dataProvider, not your
AC. Test having two DG, sort one and see if the changes get reproduced on
the second one. I bet they don't
I believe that is because the sorting process is merely moving values around within the collection by changing its index, it doesn't actually update the value assigned to each index.
Michael you may be on to something. In the code below accountsArray is the AC, but doesn't binding the AC to the datagrid's dataprovider accomplish the same thing as sorting the AC directly?
source="AssignedAccountsDataGrid.dataProvider as ArrayCollection"
Yeah remember, there's no 2-way binding in the Flex SDK 3.
Ok, so you're saying that binding is not issue and the problem is something else?
BTW, I'm still using Flex 2.
Oh I see, I meant the binding is the issue. Because if you change something in the AC, the DG will notice this change, but if you change something in the DG if you don't set it up the AC won't notice the change.
Right now I don't have the SDKs installed so I can't test it. But I think that's what's going on in your case.
There is nothing wrong with the binding.
If you have an ArrayCollection as your dataprovider, dataGrid does NOT create another arraycollection internally.
When you sort your datagrid, it sorts the actual arraycollection you set as its dataprovider then, due the the binding, the change is reflected on the datagrid.
Flex must saying that 'move' is INCLUSIVE of 'update' so it only dispatches one event.
update = value changed, move = index changed (and value changed)
i.e. you can't move without updating.
dzeikei, that is what you would think but "move" does not populate the items array with the information about the changed data like "update does" so I can't tell what the updated values are. Thanks for your help, perhaps this was an oversight by the developers.