koolyg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-29 02:00 UTC
Sortable: Need ID of moved element
Is it possible for sortable to return the element of the ID that was moved? The serialize array isn''t good enough, since if two things swap position I can''t tell which was explicitly moved. If not, how would you go about this? Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ 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, koolyg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit :> Is it possible for sortable to return the element of the ID that was > moved? The serialize array isn''t good enough, since if two things swap > position I can''t tell which was explicitly moved.Isn''t that what the onChange callback is about? I believe it takes the currently-dragged element as argument, and fires every time it changes position during a drag. OTOH, I believe indeed that onUpdate occurs on drop, only when the resulting order changed, and is passed the container element (the one you made sortable). Maybe by combining both you can obtain what you need. -- 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 -~----------~----~----~----~------~----~------~--~---
koolyg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Mar-29 18:35 UTC
Re: Sortable: Need ID of moved element
I was under the impression that onChange returned the entire serialized array every time. You were right and this does exactly what I need. Thank you! On Mar 29, 5:34 am, Christophe Porteneuve <t...-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org> wrote:> Hey, > > koo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit : > > > Is it possible for sortable to return the element of the ID that was > > moved? The serialize array isn''t good enough, since if two things swap > > position I can''t tell which was explicitly moved. > > Isn''t that what the onChange callback is about? I believe it takes the > currently-dragged element as argument, and fires every time it changes > position during a drag. > > OTOH, I believe indeed that onUpdate occurs on drop, only when the > resulting order changed, and is passed the container element (the one > you made sortable). Maybe by combining both you can obtain what you need. > > -- > 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 -~----------~----~----~----~------~----~------~--~---