>From API: "Called whenever a Draggable is released over the Droppable
and the Droppable is accepts it. The callback gets three parameters:
the Draggable element, the Droppable element and the Event. You can
extract additional information about the drop – like if the Ctrl or
Shift keys were pressed – from the Event object."

So why can't you just remove the draggable element from the dom using
a callback on the droppable? Or fire an event on the draggable item
that is observed on the draggable to destroy it, if you're worried
about the semantics of the whole thing.

On Sep 18, 9:35 pm, Grego <[EMAIL PROTECTED]> wrote:
> I would like to do a '.remove' of a draggable element after I drop it
> on a droppable item. The problem is I only have the element available
> at that time, and it looks like you need the element's draggable
> handle so that you can call '.destroy' on it.
>
> It would be better to have a '.remove' function on the Draggables
> object that accepts the dragged element that was dropped.
>
> I think it would look like this (under 'var Draggables = {'  )...
>
>   remove: function(element) {
>     var draggedItem = this.drops.detect(function(d) {
>       return d.element==$(element)
>     });
>     if (draggedItem) {
>       draggedItem.destroy()
>      };
>   },
>
> Any thoughts out there?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to