Reputation: 1406
I have 'N' number of start row (red border) I want sortable(number box 1, 2, 3 etc..) form start row(red border) to receive row(green border).
sortable should not work within start row (red border). And sortable within the receive row (green border) must work.
Note: Here i want to only disable/ cancel sortable function within the start row(red border). Below script code used.
$('.draggable-row').sortable({
connectWith:".sortable-row"
});
$('.sortable-row').sortable({
connectWith:".sortable-row"
});
Upvotes: 2
Views: 839
Reputation: 5224
You can use beforeStop
event of Sortable ,
beforeStop: function (event, ui) {
//$(ui.placeholder).parent()[0] gives target sort element
//If this is current element revert sort
if ($(ui.placeholder).parent()[0] == this) {
$(this).sortable('cancel');
}
}
I hope this will help you .
Upvotes: 1