angular-gridster2 icon indicating copy to clipboard operation
angular-gridster2 copied to clipboard

resize not resizing inner childs

Open moepkid-zz opened this issue 6 years ago • 6 comments

When resizeing a widget, the resize of the window does not get called. This results in child components and libraries like NGX-charts to not resize until after the user resizes the screen. Is there something im missing, and if so, how should i fix this?

moepkid-zz avatar Apr 01 '19 06:04 moepkid-zz

Hi @moepkid , Window resize is called only when you resize the window by the browser. If you want to resize child components when the widget is resized you should listen to the itemResizeCallback.

tiberiuzuld avatar May 12 '19 18:05 tiberiuzuld

Could anyone please point me to an example of this in action with ngx-charts? Thanks!

amad-person avatar Jun 19 '19 09:06 amad-person

same need with ngx-charts

dlarr avatar Oct 21 '19 14:10 dlarr

+1 , i'am facing same issue for Kendo charts as well as my normal html text. I have got it working here, but since my application is componentized, i'm not able to get the id of the sub div element

https://stackblitz.com/edit/tiberiuzuld-angular-gridster2-kdnkbt

gethari avatar Nov 14 '19 08:11 gethari

Did anyone get anything on this?

psychicDivine avatar Aug 06 '20 16:08 psychicDivine

There are 2 hacks to do this. tested with ngx-charts.

itemInitCallback: ((item: GridsterItem, itemComponent: GridsterItemComponentInterface) => { window.dispatchEvent(new Event('resize')); // to reisize respective charts }) 2. inside your chart components reinitialize the datasrource eg.

  // hack to resize graph
  resize() {
    this.results = [...this.results];
  }

swapnil0545 avatar Feb 28 '23 12:02 swapnil0545