Welcome to WebmasterWorld Guest from 18.205.176.85

Forum Moderators: open

Message Too Old, No Replies

Scriptaculous Sortables Dropped Element ID

     
4:11 am on Sep 5, 2007 (gmt 0)

New User

10+ Year Member

joined:Sept 5, 2007
posts:2
votes: 0


Does anyone know how to access the id of an element dropped from one sortable into a second?

I have heard that an observer can be used to do this, but can not seem to find a concrete example. Scriptaculous does not offer any examples of observers on sortables either.

I am hoping there is an internal function for this in Scriptaculous. Otherwise, I am stuck comparing two serialized lists of IDs to see what has changed.

9:04 am on Sept 5, 2007 (gmt 0)

New User

10+ Year Member

joined:Apr 16, 2006
posts:15
votes: 0


You need to also make your Sortables into Draggables and Droppables. Use the onDrop function of the Droppable to get your element - it's passed as the argument.

new Draggable('sortable',{revert:false});

Droppables.add('sortable', {
accept: 'class_of_sortables',
onDrop: function(element)
{doSomethingTo(element);}});

12:35 pm on Sept 5, 2007 (gmt 0)

New User

10+ Year Member

joined:Sept 5, 2007
posts:2
votes: 0


Thanks for the reply, but I am pretty certain that an observer can be used with the sortables to get the element id. But, like I said, the docs on this are next to non-existent...and the examples ARE non-existent!

Anyone have any experience with observers and sortables?