I am working through a sortable list issue involving two lists. What I am trying to get is the id of the child element that is dropped. I received "partial" information in an earlier post, but not enough to proceed with...it was too vague. Can someone, who does not mind getting explicit in their answer, please advise on how to access the id of a dropped element? I would really appreciate some detailed help! And, for the trouble, will update the wiki. Best, Steve --~--~---------~--~----~------------~-------~--~----~ 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 trap the ID in the onDrop event. Droppables.add(''target'', { accept: ''source'', onDrop: function(element) {alert(element) } }); On Sep 4, 7:22 pm, Steve <Steve.R...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am working through a sortable list issue involving two lists. What I > am trying to get is the id of the child element that is dropped. > > I received "partial" information in an earlier post, but not enough to > proceed with...it was too vague. > > Can someone, who does not mind getting explicit in their answer, > please advise on how to access the id of a dropped element? > > I would really appreciate some detailed help! And, for the trouble, > will update the wiki. > > Best, > > Steve--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for the reply. A couple of follow-on questions: 1) Can a Sortable have an onDrop event? If not, can an element be bound to both a Sortable and a Droppable? 2) Is ''target'' intended to be the id of the list or the id of the list member? 3) What is ''element'' in this case? Thbanks much! On Sep 5, 7:13 am, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You can trap the ID in the onDrop event. > > Droppables.add(''target'', { > accept: ''source'', > onDrop: function(element) > {alert(element) } > > }); > > On Sep 4, 7:22 pm, Steve <Steve.R...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I am working through a sortable list issue involving two lists. What I > > am trying to get is the id of the child element that is dropped. > > > I received "partial" information in an earlier post, but not enough to > > proceed with...it was too vague. > > > Can someone, who does not mind getting explicit in their answer, > > please advise on how to access the id of a dropped element? > > > I would really appreciate some detailed help! And, for the trouble, > > will update the wiki. > > > Best, > > > Steve--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Sep 5, 9:40 am, Steve <Steve.R...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks for the reply. A couple of follow-on questions: > > 1) Can a Sortable have an onDrop event? If not, can an element be > bound to both a Sortable and a Droppable?Droppable is a separate function from sortable, so yes. I use onUpdate. http://wiki.script.aculo.us/scriptaculous/show/Sortable.create> > 2) Is ''target'' intended to be the id of the list or the id of the list > member?It is the id of the list it will be dropped into.> > 3) What is ''element'' in this case?It is the id of the dragged item. Make sure it has one.> > Thbanks much! >You''re vbery welcome. :) --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
OK, tried this and when I access element.id, I get the id of the Sortable, not the dropped element. Any other possibilities? On Sep 5, 8:43 am, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sep 5, 9:40 am, Steve <Steve.R...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks for the reply. A couple of follow-on questions: > > > 1) Can a Sortable have an onDrop event? If not, can an element be > > bound to both a Sortable and a Droppable? > > Droppable is a separate function from sortable, so yes. I use > onUpdate.http://wiki.script.aculo.us/scriptaculous/show/Sortable.create > > > > > 2) Is ''target'' intended to be the id of the list or the id of the list > > member? > > It is the id of the list it will be dropped into. > > > > > 3) What is ''element'' in this case? > > It is the id of the dragged item. Make sure it has one. > > > > > Thbanks much! > > You''re vbery welcome. :)--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Strange. I''ve used this before and it worked fine. Alternately, you could create a variable called lastDrag, then change the value of lastDrag to the ID of the sortable item on the sortable''s onChange event. On Sep 5, 12:07 pm, Steve <Steve.R...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> OK, tried this and when I access element.id, I get the id of the > Sortable, not the dropped element. Any other possibilities? > > On Sep 5, 8:43 am, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On Sep 5, 9:40 am, Steve <Steve.R...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Thanks for the reply. A couple of follow-on questions: > > > > 1) Can a Sortable have an onDrop event? If not, can an element be > > > bound to both a Sortable and a Droppable? > > > Droppable is a separate function from sortable, so yes. I use > > onUpdate.http://wiki.script.aculo.us/scriptaculous/show/Sortable.create > > > > 2) Is ''target'' intended to be the id of the list or the id of the list > > > member? > > > It is the id of the list it will be dropped into. > > > > 3) What is ''element'' in this case? > > > It is the id of the dragged item. Make sure it has one. > > > > Thbanks much! > > > You''re vbery welcome. :)--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---