2012-05-09 2 views
0

ember.js 및 jQuery-ui 프레임 워크를 사용하고 있습니다. 현재는 요소를 드래그 할 수있게되어 항목이 특정 div에 드롭 될 때 이벤트를 실행할 수 있습니다.jQuery/Ember 프레임 워크를 사용하여 삭제 된 항목에 액세스

그러나 div에 떨어 뜨린 실제 요소를 가져올 수 없습니다. 전달 된 이벤트 변수는 요소가 드롭 된 div를 나타내며 'this'는 엠버 객체를 나타냅니다.

삭제 된 항목은 어떻게 액세스 할 수 있습니까? 내가 사용하고있는 코드의

개요 :

App.MyView = Em.View.extend({ 
    ... 
    drag: function (event) { 
     // This works correctly and the event here represents the actual element 
     console.log("Dragging"); 
    }, 
    drop: function (event) { 
     // This is where I am not able to access the dropped iem 
     console.log("Dropped"); 
    }, 
    ... 
}); 

감사

답변

0

당신이 jQuery를이/드래그 드롭 가능한 사용하는 경우, ui.draggable 당신을 위해 무엇을 찾고있는 사람이어야한다. 콜백에서 drop: function(event, ui) { ... }

http://jqueryui.com/demos/droppable/#event-drop

은 $ (이)은 드래그가 삭제되어 낙하 할 나타낸다. ui.draggable은 드래그 가능을 나타냅니다.

관련 문제