This repository was archived by the owner on Sep 8, 2020. It is now read-only.
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
droptargetContext is undefined when sortable nested #532
Closed
Description
Like this
<div class="grid"
data-ng-model="grid.data"
data-ui-sortable="grid.rowSortableOptions">
<div class="row"
data-ng-repeat="row in grid.data track by $index"
data-ng-model="row.cols"
data-ui-sortable="grid.colSortableOptions">
<div class="col"
data-ng-repeat="col in row.cols track by $index"
data-ng-model="col.cells"
data-ui-sortable="grid.cellSortableOptions">
<div class="cell"
data-ng-repeat="cell in col.cells track by $index">
</div>
</div>
</div>
</div>
I have fixed myself by writing 'if statement' in line 365, Like
var droptargetContext = ui.item.sortable._getElementContext(droptarget);
if(droptargetContext) {
ui.item.sortable.droptargetModel = droptargetContext.scope.ngModel;
// Cancel the sort (let ng-repeat do the sort for us)
// Don't cancel if this is the received list because it has
// already been canceled in the other list, and trying to cancel
// here will mess up the DOM.
element.sortable('cancel');
}
Metadata
Metadata
Assignees
Labels
No labels