views:

38

answers:

1

I have the jQuery UI framework's draggable and droppable elements working. I would like to programmatically determine which draggable elements are currently dropped on which droppable elements. Is there an easy way to do this?

I thought of using event listeners to detect drop and out events, then keep a dictionary or something in memory to keep track, but this seems contrived.

Better ideas?

+1  A: 

You could add a class unique to the droppable to the elements when they are dropped in each droppable, then use selectors to get the elements that are in their respective droppable zone. You would have to be sure to remove the class as they are removed that that droppable though.

Flash84x