Hello,
I am trying to add multiple sap.gantt.simple.GanttChartWithTable dynamically into a Gantt Chart Container. I have defined the empty Gantt chart container in my XML view and I want to create multiple sap.gantt.simple.GanttChartWithTable in my JavaScript controller and add them to the Gantt chart container.
I have the following code:
<gnt2:GanttChartContainer id="ganttContainer">
<gnt2:toolbar>
<gnt2:ContainerToolbar id="toolbar1" design="Auto" showBirdEyeButton="true" showLegendButton="true" ganttSidePanel="onGanttSidePanel"
showSearchButton="false" showDisplayTypeButton="true"
</gnt2:ContainerToolbar>
</gnt2:toolbar>
>
</gnt2:GanttChartContainer>
JavaScript Controller:
onInit: function () {
var oGanttContainer = this.getView().byId("ganttContainer");
var oGanttChart = new sap.gantt.simple.GanttChartWithTable(
);
oGanttContainer.addGanttChart(oGanttChart);
},
I get the following error: TypeError: Cannot read properties of null (reading 'getRowMode')
Uncaught (in promise) TypeError: e is null
_updateRowHeightInExpandModel GanttChartWithTable-dbg.js:3632
If I try as follows, I get the same error:
var abc = new GanttChartWithTable({
enableChartOverflowToolbar: true
});
oGanttContainer.addGanttChart(oGanttChart);
Thanks for the help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.