Hey Frank,

Well, from your example scenario, there's no *list within a list*
anywhere.  There are two flat lists, unembedded, strictly independent
from each other.  What I suggest is this:

- Create all three lists from the start, make the first two sortable.
- React to changes in the 2nd list by:
  a) invoking Sortable.destroy on your 3rd list
  b) invoking a Ajax.Updater on your 3rd list with the proper params
  c) using the A.U's onComplete callback, make the new list sortable by
     calling Sortable.create on it (which is required for all elements
     in it to become draggables, etc.)

The trick is, Sortable.destroy will not do a thing if the list wasn't
sortable yet, otherwise it will unregister all related
draggables/droppables, which is perfect for your needs.  Step c) will
recreate all necessary drag/drop/sort mechanisms on the updated list.

Depending on your styling, you might want to make the 3rd list hidden
with an inline "display: none" style attribute, and add extra steps
around a)-c) that toggle it.

To react to changes in the 2nd list, when you make it sortable, bind the
onUpdate callback (invoked every time the list's contents or order changes).

-- 
Christophe Porteneuve a.k.a. TDD
"[They] did not know it was impossible, so they did it." --Mark Twain
Email: [EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs
-~----------~----~----~----~------~----~------~--~---

Reply via email to