I’m using gantt Toggling to show gantt-chart and gantt-layout.
And used addTaskLayer function to render all the custom-links(SVG images) in Gantt.
When I do click on “toggle!” button and revert back to chart-view, all the links gets disappear.
Here is the snippet… https://snippet.dhtmlx.com/u9rdz2oa
made a call to gantt.render() but it doesn’t work for me.
Is there any workaround for this?
Can I write the custom elements code from renderer method to outside the addTaskLayer(). And just make a call to it from inside the renderer.
Like…
…
gantt.addTaskLayer({
renderer: {
render: function (task, selectedLinkElement, selectedLinkID, linkClick) { renderLinks(task, selectedLinkElement, selectedLinkID, linkClick);
},
…
Please suggest me, what is the correct approach to write it. https://snippet.dhtmlx.com/hps8p8fg
In the snippet, you don’t return anything, so, it should be expected that custom HTML elements are not rendered.
To make it work, you need to change these lines: