mjsarfatti / nestedSortable

A jQuery plugin that extends Sortable UI functionalities to nested lists.
http://mjsarfatti.com/sandbox/nestedSortable
881 stars 533 forks source link

Limit sorting only within the same levels #84

Open chodorowicz opened 11 years ago

chodorowicz commented 11 years ago

I'd like to sort elements only within the levels they were originally in. So element which was on 3 levels deep can only be placed under different parent, but parent must be on level 3. It would work somewhat like limiting axis: 'y' (in case of vertical tree).

Plain jQuery UI Sortable almost works with connected list, but it doesn't let to easily place elements under elements which don't have any children.

Is it possible?

mjsarfatti commented 11 years ago

Hi, it's probably doable with regular Sortable if you make sure each element keeps at least an empty ul/ol at all times.

I assigned it a Feature request tag anyway.

Spiderkeg commented 11 years ago

Using Sortable in conjunction with nestedSortable does kinda work, but the "connectWith" option prevents nesting with the newer jQuery 1.9. jQuery 1.7 appears to work. I created a working example using both the newer and older jQuery libraries.

https://github.com/mjsarfatti/nestedSortable/issues/87