Can any one explain how to use Gantt component in salesforce lightning with sample code.
GanttCompApp.app
<aura:application >
<c:GanttComp/>
</aura:application>
GanttComp.cmp
<aura:component controller=“GanttData_Custom_Controller” access=“global” >
<ltng:require styles="{!$Resource.DHX+ '/codebase/dhtmlxgantt.css'}" />
<ltng:require scripts="{!$Resource.DHX+ '/codebase/dhtmlxgantt.js'}" afterScriptsLoaded="{!c.initGantt}" />
<div id="gantt_here" style='width:10 00|px; height:420px;'></div>
</aura:component>
GanttCompController.js
({
myAction : function(component, event, helper) {
},
initGantt : function(component, event, helper) {
// Calling server-action to get the data
var action = component.get("c.getAllTask");
debugger;
// Create a callback that is executed after
// the server-side action returns
action.setCallback(this, function(response) {
var state = response.getState();
if (state == “SUCCESS”) {
let data = response.getReturnValue();
console.log(‘got data=’+data);
helper.drawAGantt(component);
}
else if(state === “ERROR”) {
var errors = response.getError();
if (errors) {
console.log("Error message: " + errors);
} else {
console.log("Unknown error");
}
}
});
$A.enqueueAction(action);
}//initGantt
})
GanttCompHelper.js
({
helperMethod : function() {
},
drawAGantt : function( component ) {
// I am currently keeping static value now
var tasks = {
data:[
{id:1, text:"Project #1", start_date:"01-04-2018", duration:18,order:10,
progress:0.4, open: true},
{id:2, text:"Task #1", start_date:"02-04-2018", duration:8, order:10,
progress:0.6, parent:1},
{id:3, text:"Task #2", start_date:"11-04-2018", duration:8, order:20,
progress:0.6, parent:1}
],
links:[
{ id:1, source:1, target:2, type:"1"},
{ id:2, source:2, target:3, type:"0"},
{ id:3, source:3, target:4, type:"0"},
{ id:4, source:2, target:5, type:"2"},
]
};
gantt.init("gantt_here");
gantt.parse(tasks);
}//drawAGantt
})
When Page loads I am getting below error
This page has an error. You might just need to refresh it.
Error in $A.getCallback() [i.contentWindow.addEventListener is not a function]
Callback failed: apex://GanttData_Custom_Controller/ACTION$getAllTask
Callback failed: apex://GanttData_Custom_Controller/ACTION$getAllTask
Failing descriptor: {c:GanttComp}
Can you please let me know to fix this issue