Home > Enterprise >  Dhtmlx gantt can't be shown inside an ion-content
Dhtmlx gantt can't be shown inside an ion-content

Time:12-22

I am developing a ionic-angular application in which I need some gantt charts, I tried to use the Dhtmlx library but when I insert the gantt chart inside an ion-content the gantt disappear (but with inspect I can see the empty space where would be the gantt).

Anyone has an idea on how I can resolve this issue? Thanks in advance.

EDIT: probably is a sort of race condition beacuse the gantt is inizialized inside the ngAfterViewInit() (not in the ngInit as in the example), there is a way to avoid this?

CodePudding user response:

It seems that when Gantt is initialized, the container has 0 pixels for the width and height, so, Gantt is shrunk. As a workaround, you can initialize Gantt after a timeout.

Here is the demo:

https://files.dhtmlx.com/30d/9d735c16565563829fab087d96937cf7/ionicframework gantt.zip

  • Related