info-Rt+jRHwf3olhrNIvIkuUv7NldLUNz+W/@public.gmane.org
2007-Dec-03 11:02 UTC
sortable: get direction up or down
Hi Group, is there a way to get the direction of the sorted element. For updating my database I need to know which direction the sorted element was dragged, because I have to add oder substrat 10 from the order-positions. Greetings, ToM --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Last time I had to do this, I used a hidden field which had the last serialization stored to it, and compared that to the current serialization. You can compare the indexOf in the array to determine if the item you are interested in (the current droppable) has moved position since the last time you seralized. Dont forget to update the hidden field onDrop. Gareth On Dec 4, 2007 12:02 AM, info-Rt+jRHwf3olhrNIvIkuUv7NldLUNz+W/@public.gmane.org <info-Rt+jRHwf3olhrNIvIkuUv7NldLUNz+W/@public.gmane.org> wrote:> > Hi Group, > > is there a way to get the direction of the sorted element. > > For updating my database I need to know which direction the sorted > element was dragged, because I have to add oder substrat 10 from the > order-positions. > > Greetings, > > ToM > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---