tiberiuzuld / angular-gridster2

Angular gridster 2
https://tiberiuzuld.github.io/angular-gridster2
MIT License
1.27k stars 378 forks source link

Items do not render at startup and need a mouseclick to render all item #654

Open jmjobin opened 4 years ago

jmjobin commented 4 years ago

I almost finished my project when I started to notice a strange behaviour. All the items do not render their content. This came up with an item with a ngx-chart-verticale-normalized. I had to click twice to see the graph. Then I noticed that after the startup all my items are without content (mostly tables) and after a click on my template all the content show up... Gridster2 is "angular-gridster2": "8.4.0",

tiberiuzuld commented 4 years ago

Hi @jmjobin , Most probably that you try to render the content before the items have height. I suggest listenening to the init callback of the items or the item resize callback and update the content.

jmjobin commented 4 years ago

Thank you so much for your feed back @tiberiuzuld and for this nice Gridster2. The problem was resolved for the page load in another way: by using ngAfterViewChecked() { this.viewref.detectChanges(); //(ChangeDetectorRef) }

Now I still have problems when adding the item... Seems to have some success adding ->ChangeDetectorRef after my data are received from the server...