MarkedTimespan mouse events

Hi,

Is there a way to listen for a click ou mousedown event on a MarkedTimespan ?

Thank you.

Hi,
detecting marked timespan is not difficult, but there is no intuitive way to catch mouse down event. The scheduler’s onMouseDown triggers when the target element has no default handler for d’n’d. Most scheduler elements has it, so this events most often will trigger when you hit the content of event-box.
Instead of this, you may use onBeforeDrag event, which is also triggered on mousedown.

The general approach for detecting marked timespan is to retreive pointed date of the calendar, and check it with checkInMarkedTimespan method.
The code might be following[code]function detectTimespan(event){
var target = scheduler.getActionData(event);
if(scheduler.checkInMarkedTimespan({
start_date:target.date,
end_date:scheduler.date.add(target.date, scheduler.config.time_step, ‘minute’),
section_id:target.section//‘section_id’ - name of the property mapped to Timeline of Units view
})){

	dhtmlx.message("Click on marked timespan");
}else{
	dhtmlx.message("Click on empty space");
}

}

//check click target
scheduler.attachEvent(“onEmptyClick”, function(date, event){
detectTimespan(event)
return true;
});

//check mousedown target
scheduler.attachEvent(“onBeforeDrag”, function(id, mode, event){
detectTimespan(event)
return true;
});[/code]
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … event.html
docs.dhtmlx.com/scheduler/api__s … ndata.html
docs.dhtmlx.com/scheduler/api__s … espan.html

Thanks !