cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How can I add several Simple Gantt Charts into a Simple Gantt Chart container in SAPUI5?

Hxseyn
Explorer
0 Likes
743
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

Accepted Solutions (1)

Accepted Solutions (1)

M-K
Active Participant

It should be possible, however you can't add an empty GanttChartWithTable without Table-Control (aggregation "table") in it.

(I get the same error in the console when I try out the SAPUI5-Example and delete the <table:TreeTable> from Gantt.view.xml)

Answers (0)