Hi there, I''m started to use scriptaculous yesterday and it''s really great. Hovever, there is one problem that I cannot solve: I have a page with a sortable list and a droppable "trash can". I would like to drag and drop items between the list and the trash can, but it don''t work. Which options should I set to make it works correctly? Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hey there, stani a écrit :> I have a page with a sortable list and a droppable "trash can". I > would like to drag and drop items between the list and the trash can, > but it don''t work. Which options should I set to make it works > correctly?1) Make sure your Droppables.add options include the sortable element (container)''s ID in its ''containment'' option. 2) To effectively remove the element when dropped, put this in the trashcan''s onDrop callback: onDrop: function(item) { $(item).remove(); // More code, e.g. AJAX sync... } ''should do the trick. Otherwise, the Shop example on the wiki does this, too. -- Christophe Porteneuve aka TDD 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 -~----------~----~----~----~------~----~------~--~---
Hi Christophe, Thanks for a quick answer, it works! Merci On Apr 13, 4:23 pm, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey there, > > stani a écrit : > > > I have a page with a sortable list and a droppable "trash can". I > > would like to drag and drop items between the list and the trash can, > > but it don''t work. Which options should I set to make it works > > correctly? > > 1) Make sure your Droppables.add options include the sortable element > (container)''s ID in its ''containment'' option. > > 2) To effectively remove the element when dropped, put this in the > trashcan''s onDrop callback: > > onDrop: function(item) { > $(item).remove(); > // More code, e.g. AJAX sync... > } > > ''should do the trick. Otherwise, the Shop example on the wiki does > this, too. > > -- > Christophe Porteneuve aka TDD > t...-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 -~----------~----~----~----~------~----~------~--~---