I do not know your exact structure, but you can use the connectClass option to manage the list of sortable lists. For example, if you did this:
<ul data-bind="sortable: { data: buckets, connectClass: 'buckets' }"> <li> <span data-bind="text: name"></span> <ul data-bind="sortable: { data: items, connectClass: 'items' }"> <li data-bind="text: name"></li> </ul> </li> </ul>
You could only remove the bucket in the buckets and the item in the items. The plugin automatically adds the class to the parent element.
Here is an example: http://jsfiddle.net/rniemeyer/YaLgL/
If you do not want to sort items between buckets, you can apply a unique connectClass for each type:
http://jsfiddle.net/rniemeyer/czNe8/
source share