timelines-chart icon indicating copy to clipboard operation
timelines-chart copied to clipboard

On-Click for entry?

Open Tmktahu opened this issue 6 years ago • 2 comments

I've been able to use the onLabelClick callback function just fine, but I have a need to drill down into the entries themselves to see more detailed information.

Is it possible to have an onClick function for the time entries themselves? Right now a tooltip comes up when you hover over them, so I would assume that an onClick behavior would be simple to add, but I'm unsure.

Tmktahu avatar Mar 06 '18 00:03 Tmktahu

See https://github.com/vasturiano/timelines-chart/pull/29

ArchiMoebius avatar Jan 04 '19 18:01 ArchiMoebius

This works to get the clicked segment. But is there a way to access the event? I want to use the event to find the DOM element to toggle a highlight of it when clicked.

I used

var e = event || window.event;
if(e){
    var target = e.target || e.srcElement;
    target.classList.toggle("clicked-gantt-item");
}

which works perfectly fine in both Chrome and Edge. However, Firefox does not allow access to the global event variable.

Normally the event itself is put as one of the arguments in the callback. But as far as I can tell not here.

tkarls avatar Feb 28 '19 17:02 tkarls