Hi
i need to get the date and time from the scheduler ondrop event. I am using prototype drag and drop functionality to drop and drop event in the scheduler and call the Ajax updater to update in the database.
the problem is i can pass the event name dymamically. i need to to get the date and time of the mouse drop co ordinates.
using the prototype drag and drop functionality i can call some method on onDrop of js to update the database.
my code is below…
onDrop: moveItem
function moveItem( draggable,droparea){
draggable.parentNode.removeChild(draggable);
scheduler.attachEvent(“onmouseup”, madhan());
}
function madhan() {
alert(‘on Drop’);
dhtmlxEvent(scheduler._els[“dhx_cal_data”][0],“mouseup”,function(e){
e = e||event;
var pos = scheduler._mouse_coords(e);
var timestamp = scheduler._min_date.valueOf()+(pos.y*scheduler.config.time_step+(scheduler._table_view?0:pos.x)2460)*60000;
alert(timestamp);
});
}
i am not getting the timestamp.
but alert message “on Drop” is coming…
hello stanislav,
Thank you for your reply. My requirement is , when the user drag the event name from the external div and drop inside the scheduler , need to get the onDrop coordinates in the scheduler and get the date and time according to that ondrop mouse coordinates and update the event in the database.
Hi,
I have the same requirement as you, so you can override get_value function in scheduler.form_blocks[“time”].get_value to get your current time.
Below was a sample for you refer:
var currentStart;
var currentEnd;
get_value:function(document,currentStart, currentEnd){
s=document.getElementsByTagName(“select”);
currentStart=new Date(s[3].value,s[2].value,s[1].value,0,s[0].value);
currentEnd=new Date(s[7].value,s[6].value,s[5].value,0,s[4].value);
}
you are getting the start and end time from the select box, but i need to get the start time from onDrop event, that too from drag event name from the external div to inside the scheduler.
Hi,
I got this error "object does not support this property" in line start = this._correct_shift(start); . Do you have any idea?
Update your codebase to the version 2.2