Nested Sortable problem
Nested Sortable problem
Sortable nested lists is a problem with jQuery UI's "sortable()"
plugin. The problem is the nesting part; if you move list elements out
of a containing element (e.g. "up" in the hierarchy) and the
containing element suddenly becomes empty, it's impossible to move the
items back into the containing element. Just try it out here:
<http://jquery-ui.googlegroups.com/web/ui.sortable.html>
or here:
<http://ui.jquery.com/1.5a/demos/sortable.html>
In the "Nested lists" example, drag all elements to the top level and
see what I mean. They're stuck on the top level forever, without any
possibility to move them down in the hierarchy.
If it's possible to get around this with some custom code, I'd
appreciate a pointer or an example of how it can be done. So far, I
haven't found a solution. I basically need to be able to move any list
item inside any list item, no matter its or its container's position
in the hierarchy.
If this requires me to create UL or OL elements with jQuery inside
every LI element in the list, then okay, but I've tried this already
(even with static HTML) and it seems as long as a UL or OL is empty
(e.g. with no LI elements) it cannot be used as a drop target. Is this
a bug or is this just an impossible feature to implement?
Thanks for any help thrown in my general direction.
-Asbjørn