Christophe Decaux
2010-Mar-29 14:07 UTC
Issue with Sortables and Rails. Is it Javascript/rails problem?
Hi there,
I have an issue with Sortables that I can''t figure out. I''m
not sure if this issue is related to Sortables or if it is a more generic
Javascript/Rails interaction issue
Let''s say I have a sortable with a list of items, but the top 3
elements have special meaning.
What I''d like to accomplish is to be able to identify if the element
that is moved in my sortable belongs to the top 3. And if this is the case, I
have some action to apply to it.
I''ve seen that there is an onChange option in the sortable_element
which allows me to identify the element, but this is JavaScript code at this
point.
<%= sortable_element ''messages'',
:url => {:action => ''sort_messages''},
:onChange => "function(element){moved_message = element.id}"
%>
Does anyone knows how to access this javascript variable in my sort_message
action?
Apologies if I''m not clear enough,
Thanks in advance,
Christophe
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.