search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

makeDraggable() remove

Asked by ikkes
6 years ago.

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.

Comment posted by james
6 years ago.

Hello,

I have te same issue. is i drop the item on the trashcan the directive don't do anything?

Can somebody help?

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.