Skip to content
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
@soonwait

Description

@soonwait

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions