简体   繁体   English

Dhtmlx 甘特图无法在离子内容中显示

[英]Dhtmlx gantt can't be shown inside an ion-content

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).我正在开发一个离子角度应用程序,其中我需要一些甘特图,我尝试使用 Dhtmlx 库,但是当我将甘特图插入离子内容中时,甘特图消失了(但通过检查我可以看到空白空间成为甘特图)。

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?编辑:可能是一种竞争条件,因为甘特图是在 ngAfterViewInit() 内部初始化的(而不是在示例中的 ngInit 中),有办法避免这种情况吗?

It seems that when Gantt is initialized, the container has 0 pixels for the width and height, so, Gantt is shrunk.似乎在初始化甘特图时,容器的宽度和高度为 0 像素,因此,甘特图被缩小了。 As a workaround, you can initialize Gantt after a timeout.作为一种解决方法,您可以在超时后初始化甘特图。

Here is the demo:这是演示:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM