Daniel Smedegaard Buus
2007-Mar-22 10:29 UTC
draggable_element: How to get id of dragged element, AND receiving element?
Hey :)
I''m creating a drag-and-drop tree structure using draggable_element. I
use this code,
<%draggable_element(content_element_id, :ghosting=>true,
:revert=>true)
%>
<%= drop_receiving_element(content_element_id,
:accept => ''tree_item'',
:complete => "$
(''#{content_element_id}_activity_indicator'').hide();",
:before => "$
(''#{content_element_id}_activity_indicator'').show();",
:hoverclass => ''hovering'',
:with =>
"''child_id='' +
encodeURIComponent(element.id.split(''_'').last())",
:url => { :action => :adopt } ) %>
This way, I can send the id of the element that is being dragged, to
the :adopt action in my controller. But I need to know which element
the dragged element was dropped upon, so it can be adopted by the
right parent.
Anybody know how I can do that?
Thanks in advance,
Daniel :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Daniel Smedegaard Buus
2007-Mar-22 10:46 UTC
Re: draggable_element: How to get id of dragged element, AND receiving element?
Ah, silly me :)
Just have to add it to the drop_receiving_element call in :url!
:url => { :action
=> :adopt, :parent_id => navigation_point.id } )%>
Cheers :)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---