PDA

View Full Version : DragDrop event handler and PreventDefault question


Guitarguy5
02-19-2008, 02:19 AM
If I call preventDefault() from within the DragDrop event handler for a List component, how do I reset the Drop targets appearance back to it's pre-drag state?

I have 2 Lists which are both bound to XML data The destination List has dragDrop enabled. When I drag an item from the source list over to the destination List, I see the drag proxy image and notice that the destination lists border is highlighted in a new color.

When I drop the item onto the destination list, in the DragDrop event handler I call the preventDefault method, as I want to unpackage the dragged XML data and make it's schema match the XML data for the destination list. This is all working fine.

I call preventDefault() from within this event handler so that I can manually assign the destination List's dataProvider property.

Now, the problem is that the destination List is left sitting there with a colored border. How do I reset that back?

Guitarguy5
02-19-2008, 03:12 AM
Figured it out....

Have to get a reference to the destination Drop target and then call the hideDropFeedback method.

So from within my DragDrop event handler I have the following:

var destList:List = event.currentTarget as List;
destList.hideDropFeedback(event);