Click event on gantt.templates.rightside_text

DHTMLX Snippet Tool_gaNTI5OTI3NjM0LjE3Mjk0NjE0MzE._ga_N87XPB4GSGMTczMTMwOTUxMC4zNC4xLjE3MzEzMDk3NjkuMzQuMC4w

Using the above sample snippet to trigger a custom html. The code doesn’t work.

Error thrown is gantt.$taskAction is not a function.

Is there an alternate way to trigger the event? Please help anyone who knows about it.

Hello Debjoy,
The $taskAction is a custom property that is added to the gantt object. So, if you use Typescript, it is expected that you don’t have the types for that property. You need to manually add the types.

It is also possible that the gantt object is not available globally, so, it is expected that you get an error.
Here is an example in the snippet:
https://snippet.dhtmlx.com/xosq8avn

Instead of adding the onclick function, you can use the onTaskClick event handler and call the necessary code from that function:
https://docs.dhtmlx.com/gantt/api__gantt_ontaskclick_event.html

Here is an example of how it can be implemented:
https://snippet.dhtmlx.com/k4y2qtik