question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to access to dropped element? drop(event, ui) not works in jqyoui-options

See original GitHub issue

I just writed this in template:

jqyoui-options="droppableOptions"

And in controller:

$scope.droppableOptions = {
  drop: function(event, ui){
    console.log('drop ui', ui);
   },
   ...
}

But it don’t works. Even defining drop function in a scope not works:

$scope.dropFunc = function(event, ui){
        console.log('yep');
$scope.droppableOptions = {
  drop: 'dropFunc',
   ...
}

Any solution?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
mukumar-qasourcecommented, Apr 21, 2017

@loverdrive did you find a solution for this. I am also doing the same thing. but on beforeDrop

$scope.beforeDropCallback = function(evt, ui){ var obj = ui.draggable.scope(); }

But ui.draggable.scope() returns undefined. Not sure what I am doing wrong

If I inspect the scope() function. It accepts two arguments. But none of the issue threads have mentioned it.

0reactions
loverdrivecommented, Nov 27, 2015

This callback

$scope.dropCallback = function(evt, ui){
    var obj = ui.draggable.scope().dndDragItem;
}

dosn’t found scope: Cannot read property ‘dndDragItem’ of undefined

also

$scope.draggedTitle

gives me ‘undefined’

I need to have access to dropped element and dropzone, but i can’t understand how i can do it.

Thank you very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery Droppable, get the element dropped - Stack Overflow
From the drop event documentation: This event is triggered when an accepted draggable is dropped 'over' (within the tolerance of) this droppable.
Read more >
ondrop Event - W3Schools
The ondrop event occurs when a draggable element or text selection is dropped on a valid drop target. Drag and drop is a...
Read more >
Drag and Drop Overview - WPF .NET Framework
The drag source and drop target may be UI elements in the same application ... OLE drag-and-drop does not work while in the...
Read more >
Drag'n'Drop with mouse events - The Modern JavaScript Tutorial
Use event delegation to track drag start: a single event handler on document for mousedown . If elements are dragged to top/bottom window...
Read more >
File drag and drop - Web APIs | MDN
This example illustrates the use of both APIs (and does not use any ... The target element of the drop event needs an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found