Looking through the posts regarding my search criteria of drap and drop
and Array collection, I couldn't find a post which cleared up the task
of updating a data provider, in this case, an array collection, after an
item is dragged to its datagrid from another. Purely using the default
settings(no code other than the settings in the MXML tags), I can drag
an object from one grid to another and have that item appear perfectly
in there barring a few things I plan to add after the fact. What I'm
guessing, and please correct me if I'm wrong, but I would need to invoke
an event through the dragDrop or dragComplete events? Also would I be
correct to assume that the skeleton of such a function would look like
this?
private function dragToOrders(event:DragEvent):void
{
//Insert whatever logic to happen when the event happens
}
Where I'm getting stuck the most is the logic inside that skeleton, I
have a rough idea on what would happen with this:
orderDetailArray.addItem(/*What represents the item being dragged?*/);
orderDetailArray.Refresh();
Would this be at least close to correct? Also, since the items being
dragged are products, I'd need to find a way to simply increment a field
in the dataprovider instead of adding another row of the exact same
thing, though I believe this is a simple check to see if the item being
added is the same as something already in the arraycollection via a
loop.
If this seems vague then place let me know so we can clear this up,
also, pointers to posts I may have missed, blogs or tutorials on similar
subject matter would help. Thanks in advance,
Brian Ross Edwards
Tech-Connect LLC