DHTMLX Scheduler timeline click on day_date

367 Views Asked by At

In a scheduler timeline view having a second_scale, is it possible to click on a single date? I have found this answer, but I'm wondering if there is an event in the meantime.

enter image description here

1

There are 1 best solutions below

4
Polina On BEST ANSWER

There are onXScaleClick, onXScaleDblClick events for the Timeline view. But in case, when you have 2 scales, they fire only for the second one. Check console in the snippet that demonstrates it.

Nonetheless, you can add onclick event listener for the first scale using js:

var dateScaleEl = document.querySelector(".dhx_second_scale_bar");
dateScaleEl.onclick = function() {
    var targetDate = scheduler.getState().date;
    console.log(targetDate);
}

Demo.

getState() is a method to get the active date.