In the code below, sorting in the start event is not completely disabled. It will add the ui-sortable-disabled and ui-state-disabled classes to the elements to be sorted, but it will not disable the functionality - in other words, the sorts look disabled, but they still accept the dragged item and behave as if they were enabled.
var assignedSortables; var startDrag = function(event, ui) { assignedSortables.each(function() {$(this).sortable('disable');}); }; var stopDrag = function(event, ui) { assignedSortables.each(function() {$(this).sortable('enable');}); }; assignedSortables = $(".my-sortable-containers").sortable({ connectWith: '.my-sortable-containers', start: startDrag, stop: stopDrag });
The reason I want to do this is to start dragging, because I may need to disable other related sorts that already contain the item that is being dragged (I simplified the logic to simplify). Is this a mistake or is there a way around this?
source share