I have a simple example of jquery ui. Basicly i have to list of items, each one is sortable. And what i want to accomplish is the following:
cancel sorting of the same list. with an example, if I click over an element on position one on list one, then drag it to position 6, and dropped. I want to prevent that, but if i drop the element in list two, that is ok.
i don’t know how to specify, in order to fit my requeriments. ConnectWith seems not to be enough:
$("#sortable").sortable({
connectWith: [$('#sortable2')]
});
$("#sortable2").sortable({
connectWith: [$('#sortable')]
});
here is the example:
This may not be exactly what you are looking for, but you can bind to the
receiveandstopevents (they trigger in that order).receiveindicates that a list item was received from another list. When this is triggered, you can temporarily unblock sorting.stopattempts to block sorting at all times:http://jsfiddle.net/sQeZE/5/