views:

45

answers:

1

I have a drag-and-drop event form in a flex project. I need to run a validator right after the item is dragged into the dataGrid. In it, I fire off a function through dragDrop="verifyEventUsers()". In the validator, I compare the contents of the two arrayCollections, but it appears to be running the checks prior to completion of the drop. For instance, if I drag an element into the dataGrid and trace eventUsers.length inside the validator, I get zero. When I drag the second element, it traces as one even though two lines now appear.

How can I set up a validation script that runs after the drag-drop action has finished?

+1  A: 

I figured out the solution just a few minutes after asking the question. In this situation, I have one source grid and one destination grid, so it's easy. In the dragDrop function, I used event.preventDefault(); I can then look at the selected row of the source grid, check the necessary conditions and drop the element in the target only if those conditions are met.

Charles Shoults
+1 for coming back and answering your own question.
jason