Hello,
I need some help makeDraggable().
I want to drop an external item on a picture(trashcan) to remove the item and trigger a function.
What is the bestpractice.
function makeDraggable() {
var parent = document.getElementById("external");
var items = parent.getElementsByClassName("item");
for (var i = 0; i < items.length; i++) {
var e = items[i];
var item = {
element: e,
remove: e,
id: e.getAttribute("data-id"),
text: e.innerText,
duration: DayPilot.Duration.hours(e.getAttribute("data-duration")), // hours
tags:{
status: e.getAttribute("data-status")
},
onDragStart: function(args) {
window.console && console.log('Dragstart');
}
};
DayPilot.Scheduler.makeDraggable(item);
}
}
makeDraggable();
The 'ondrop' event dont work inside the 'div'.
Thank you.