Hi guys, I have many Sortables, and I can drag elements between them. Say I have Sortables ''start'', ''middle'', and ''end''. I want to move an element from ''start'' to ''end'', but need to drag the element across ''middle'' to get there. When I drag over ''middle'' I trigger an onChange event if I cause an overlap with one of the elements inside ''middle''. When I eventually reach ''end'', but don''t overlap with any element there (thereby not causing an onChange event), and try to drop it on ''end'', it gets dropped on ''middle'' instead. Is there anything I can do to prevent this from happening? Thanks Joerg --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
You can prevent _all_ drops on ''middle'' using the ''containment'' option, but I don''t think that''s what you want. If you want it to revert back to its original location, no matter where it''s recently marked location is, you''ll have to do some custom code. A sortable observer might work for you. (onStart, onEnd, etc.) http://wiki.script.aculo.us/scriptaculous/show/Sortable.create TAG On Jul 30, 2007, at 2:16 PM, Joerg wrote:> > Hi guys, > > I have many Sortables, and I can drag elements between them. > > Say I have Sortables ''start'', ''middle'', and ''end''. I want to move an > element from ''start'' to ''end'', but need to drag the element across > ''middle'' to get there. When I drag over ''middle'' I trigger an onChange > event if I cause an overlap with one of the elements inside ''middle''. > When I eventually reach ''end'', but don''t overlap with any element > there (thereby not causing an onChange event), and try to drop it on > ''end'', it gets dropped on ''middle'' instead. > > Is there anything I can do to prevent this from happening? > > Thanks > Joerg > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Cool thanks I''ll take a look at that. On Jul 31, 2:50 am, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote:> You can prevent _all_ drops on ''middle'' using the ''containment'' > option, but I don''t think that''s what you want. If you want it to > revert back to its original location, no matter where it''s recently > marked location is, you''ll have to do some custom code. A sortable > observer might work for you. (onStart, onEnd, etc.) > > http://wiki.script.aculo.us/scriptaculous/show/Sortable.create > > TAG > > On Jul 30, 2007, at 2:16 PM, Joerg wrote: > > > > > Hi guys, > > > I have many Sortables, and I can drag elements between them. > > > Say I have Sortables ''start'', ''middle'', and ''end''. I want to move an > > element from ''start'' to ''end'', but need to drag the element across > > ''middle'' to get there. When I drag over ''middle'' I trigger an onChange > > event if I cause an overlap with one of the elements inside ''middle''. > > When I eventually reach ''end'', but don''t overlap with any element > > there (thereby not causing an onChange event), and try to drop it on > > ''end'', it gets dropped on ''middle'' instead. > > > Is there anything I can do to prevent this from happening? > > > Thanks > > Joerg--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---