IBM / gantt-chart

IBM Gantt Chart Component, integrable in Vanilla, jQuery, or React Framework.
https://ibm.github.io/gantt-chart/packages/ibm-gantt-chart-docs/storybook
Apache License 2.0
215 stars 52 forks source link

Question: Show tooltip on click #56

Closed spliner21 closed 2 years ago

spliner21 commented 2 years ago

Hi,

I need to change the behavior of the gantt chart, so that tooltip would show up on click. Is it possible to achieve somehow? Or will I have to alter the code of the plugin?

Thanks in advance!

delhoume commented 2 years ago

Sorry I have no idea, you may have to look at the code

delcacho commented 2 years ago

Place this in a click listener:

activityClicked(e, act, date, row) { act.gantt.tooltip._tooltip.style.visibility = "visible" },

yobdoy commented 6 months ago

Place this in a click listener:

activityClicked(e, act, date, row) { act.gantt.tooltip._tooltip.style.visibility = "visible" },

@delcacho hi Thanks for the example, this is what I've tried and it's working with showing me the HTML element object, however this alert is shown everywhere I click and it doesn't get the activity clicked function, would it be possible to provide an example,

Also i checked the code here but not sure to which element the click event needs to be bound to,

Thanks!

gantt.timeTable.utils.addEventListener(this,'click',(e)=>{ e.preventDefault; alert(e.target) },true)