Hi there, Is there any easy way to allow the user to drag an item to the middle of a list of sortables? I mean, in my system the user can drag a draggable to sortable droppable and I have to actually create a different item based on a menu selection, so I do an appendChildNode. Which is fine, but it adds the new element to the bottom of the list. I would like to figure out where in the list the user dropped it and then set the position of the new element, but I''m not sure how. Anyone know of an easy way? Thanks! Mark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
IIRC, Sortable recognizes the options for Droppable, so ''accept'' should be enough (this is used to allow cross-dragging between sortables, for instance). Check this page for inspiration: http://wiki.script.aculo.us/scriptaculous/page/print/SortableListsDemo -- Christophe Porteneuve a.k.a. TDD "[They] did not know it was impossible, so they did it." --Mark Twain Email: tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
True, but I don''t have two sortables, I only have a set of droppables and a sortable, and when I add a droppable to a sortable I actually prompt the user for some input and then manually add an element to the sortable and then re-create the sortable. This is why I need to be able to figure out where in the sortable the original element was dropped... Mark --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
It sounds like you have a set of *draggables* (things that can be dragged and dropped) not a set of droppables (places where draggables may be dropped). I would suggest using a sortable observer, to which you can attach a callback to check whether the item dropped on your sortable is one of the special cases. You can figure out its drop location programatically from there. TAG On Jan 11, 2007, at 3:54 AM, mwaschkowski wrote:> > True, but I don''t have two sortables, I only have a set of droppables > and a sortable, and when I add a droppable to a sortable I actually > prompt the user for some input and then manually add an element to the > sortable and then re-create the sortable. This is why I need to be > able > to figure out where in the sortable the original element was > dropped... > > Mark > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---