私は ember.js と jQuery-ui フレームワークを使用しています。現在、要素をドラッグ可能にすることができ、アイテムが特定の div にドロップされたときにイベントを発生させることができます。
ただし、div にドロップされた実際の要素を取得できません。渡されたイベント変数は、要素がドロップされた div を表し、「this」は ember オブジェクトを表します。
ドロップされたアイテムにアクセスするにはどうすればよいですか?
私が使用しているコードの概要:
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");
},
...
});
ありがとう