Reputation: 123
I have a problem, i try to do complex sorting: example
without group
-child0
-- GROUP1
-child1
-child2
-- GROUP2
-child3
-child4
I need groups to be sorted (move all group down), with all childs, and childs of a group (make child4 upper then child3), and childs between groups (move child4 to group2 ), or make child out of group, can i make this with jquery ui sortable, or any ready solution?
Upvotes: 0
Views: 139
Reputation: 18109
Try this code: http://jsfiddle.net/lotusgodkk/28nMJ/201/
$(function () {
$('ul.mainlist').sortable({
connectWith: 'ul',
});
$('ul.sublist').sortable({
connectWith: 'ul'
});
});
HTML:
<ul class='mainlist'>
<li>One (a)</li>
<li>Two (a)</li>
<li class="hasItems">Three (a)
<ul class="sublist">
<li>subitem1-1</li>
<li>subitem1-2</li>
<li>subitem1-3</li>
<li>subitem1-4</li>
</ul>
</li>
<li>Four (a)</li>
<li class="hasItems">Five (a)
<ul class="sublist">
<li>subitem2-1</li>
<li>subitem2-2</li>
<li>subitem2-3</li>
<li>subitem2-4</li>
</ul>
</li>
</ul>
<ul class='mainlist'>
<li>1</li>
<li>Two (b)</li>
<li>Three (b)</li>
</ul>
Upvotes: 1