Oh yes you are right, I forgot to respect that. Thanks.
My customers don’t want to use it. So that’s why I’m trying to find a solution using drag and drop functionality.
Made a few changes recently. I removed the updates to the DB, because I don’t know where to put it :
function init() {
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.init('scheduler_here',new Date(2018,0,1),"week");
scheduler.config.drag_move = true;
scheduler.config.drag_create = true;
var dragged_ev;
var date_drag;
scheduler.attachEvent("onBeforeDrag", function (id, mode, e){ //e = mouseEvent
if (e.ctrlKey)
{
var event = scheduler.getEvent(id);
var delta = event.end_date - event.start_date; //en ms
var dateFin = new Date(date_drag);
dateFin.setSeconds(dateFin.getSeconds() + (delta/100));
dragged_ev = event;
console.log("dateDeb : " + date_drag + " \ndateFin : " + dateFin);
var eventId = scheduler.addEvent({
start_date: date_drag,
end_date: dateFin,
text: "Meeting"
});
id = null;
mode = "copy";
}
return true;
});
scheduler.attachEvent("onMouseMove", function(event_id, native_event) {
date_drag = scheduler.getActionData(native_event).date;
});
}
I would like to copy the dragged event to the new position. When I refresh, it finally cut the event to the new location.
I think the problem is coming from the save to the DB. How can I manually save an event ? (Triggering manually onEventSave ?)
Sorry if you already answered this question, thank you for your time.
Khwaja
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan