【发布时间】:2012-05-09 13:32:37
【问题描述】:
我正在使用 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");
},
...
});
谢谢
【问题讨论】:
标签: javascript jquery-ui ember.js jquery-ui-droppable