I am unsure why setData
and getData
is undefined whenever I call it through jQuery UI.
I am doing
$(`#selector`).draggable({
start: function(event: any) {
drag(event);
},
stop: function(event: any) {
console.log('stopped');
}
});
and in drag():
drag(event: any) {
event.originalEvent.dataTransfer.setData("text, application/x-moz-node", event.target.id);
}
The originalEvent
is in reference to this solution here
However, I am still receiving the same results.
Cannot read property 'setData' of undefined
I am using typescript as well (not sure how much of a difference this makes).