Hello, I have managed to make an event show details when you put the mouse over it with:
scheduler.attachEvent(“onMouseMove”, function(id, e) {
if(id) { scheduler._on_dbl_click(e); }
return false;
});
But how can I make it close the event and go back to calendar view when you move your mouse off of the event details?
Thanks for any help.
If you are mean “lightbox” - it covers whole page, so while it is opened, you will not catch any events.
Thanks for the reply.
OK… so can I attach an event to the portion of the lightbox that contains the details, so that when mouseoff of it, it closes the lightbox? Is there a different way other than using the lightbox?
I’m open to suggestions here. My client wants to mouseover the event to show it, mouseoff to hide it.
Thanks!
dhtmlxEvent(document.body, "mousemove", function(e){
var src=e?e.target:event.srcElement;
if (src.className == "dhx_cal_cover")
do_something();
})
do_something will be called when lightbox is shown and mouse is hovered outside of details form.
OK, thank you again! But I’m still missing something. I can get it to do an alert or whatever, but I still can’t get it to close the lightbox. Here’s the code I have. As you can see I put the event id into window.eventid, which if I alert I get a number back, so that’s getting passed. But you can see in the 3 commented out lines after the alert, I am trying different ways to cancel the event details lightbox. I looked in the forums and found some examples, etc. But I tried all 3 of those and none of them will close or cancel the event.
So how do I get it to close the lightbox?
Thank you for your help again.
scheduler.attachEvent("onMouseMove", function(id, e) {
if(id) {
// if mouse is moved over an event, show details or create new (same as double click)
// set window.eventid to event that details are open for
scheduler._on_dbl_click(e);
window.eventid = id;
}
return false;
});
dhtmlxEvent(document.body, "mousemove", function(e){
var src=e?e.target:event.srcElement;
if (src.className == "dhx_cal_cover"){
// close lightbox for event
alert(window.eventid);
//scheduler._edit_stop_event(scheduler.getEvent(window.eventid),true);
//scheduler.editStop(window.eventid);
//scheduler.editStop(scheduler.getEvent(window.eventid));
}
});
if (src.className == "dhx_cal_cover"){
scheduler.cancel_lightbox();
or
if (src.className == "dhx_cal_cover"){
scheduler.save_lightbox();
editStop method is related to the inline editor, and not affect lightbox
Final code in case anyone else is interested.
scheduler.attachEvent("onMouseMove", function(id, e) {
if(id) {
// if mouse is moved over an event, show details (same as double click)
// set window.eventid to event that details are open for
scheduler._on_dbl_click(e);
}
return false;
});
dhtmlxEvent(document.body, "mousemove", function(e){
var src=e?e.target:event.srcElement;
if (src.className == "dhx_cal_cover"){
// close lightbox for event
scheduler.cancel_lightbox();
}
});
Oops, spoke too soon. It gives an error in IE.
‘className’ is null or not an object
Any help?
Next must work correctly
[code]scheduler.attachEvent(“onMouseMove”, function(id, e) {
if(id) {
// if mouse is moved over an event, show details (same as double click)
// set window.eventid to event that details are open for
scheduler._on_dbl_click(e);
}
return false;
});
dhtmlxEvent(document.body, “mousemove”, function(e){
e = e||event;
var src=e.target||event.srcElement;
if (src.className == “dhx_cal_cover”){
// close lightbox for event
scheduler.cancel_lightbox();
}
});[/code]
THANK YOU VERY MUCH. That did the trick.