I haven''t tried out your code, but given your description, perhaps
what you want to do is use SortableObservers instead of multiple
sortables. See dragdrop.js for an example.
TAG
On Aug 13, 2007, at 3:17 AM, Tarscher wrote:
>
> Hi all,
>
> I have a list of user belonging to groups. A user can belong to
> multiple groups. Every group is represented as a list <ul></ul>
with
> the user <li></li>. My website user should be able to both move
and
> copy a user from group to group.
>
> I created a handle for both copy [C] and move [M] and assigned to each
> list 2 sortables (see code), one with ghosting (for copying) and
> another without. It seems that you can''t assign to sortables to 1
> list.
>
> I assume that what I want to do has been done before? Maybe someone
> can help me out here.
>
> Regards,
> Stijn
>
>
> <style type="text/css">
> span.handle_move
> {
> color: #999999;
> }
>
> span.handle_copy
> {
> color: #909090;
> }
>
> li
> {}
> </style>
>
> <h1>Drag Drop</h1>
> <h2>lijst 1</h2>
> <ul id="list_1">
> <li>
> <span>
> <span id="user_1">
> <span class="handle_move">[M]</span>
> <span class="handle_copy">[C]</span>
> </span>
> Wouter
> </span>
> </li>
> <li>
> <span>
> <span id="user_2">
> <span class="handle_move">[M]</span>
> <span class="handle_copy">[C]</span>
> </span>
> Stijn
> </span>
> </li>
> </ul>
>
> <h2>lijst 2</h2>
> <ul id="list_2">
> <li>
> <span>
> <span id="user_3">
> <span class="handle_move">[M]</span>
> <span class="handle_copy">[C]</span>
> </span>
> Dries
> </span>
> </li>
> <li>
> <span>
> <span id="user_4">
> <span class="handle_move">[M]</span>
> <span class="handle_copy">[C]</span>
> </span>
> Steven
> </span>
> </li>
> </ul>
>
> <script type="text/javascript"
language="javascript">
>
Sortable.create(''list_1'',{containment:[list_2],handle:''handle_copy'',
> ghosting: true,dropOnEmpty: true, constraint:false})
>
Sortable.create(''list_1'',{containment:[list_2],handle:''handle_move'',
> dropOnEmpty: true, constraint:false})
>
Sortable.create(''list_2'',{containment:[list_1],handle:''handle_move'',
> dropOnEmpty: true, constraint:false})
>
Sortable.create(''list_2'',{containment:[list_1],handle:''handle_copy'',
> ghosting: true, dropOnEmpty: true, constraint:false})
> </script>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---