angular-ui/ui-grid

handleWindowResize doesn't work properly when footer visibility changes at runtime

Open

#4801 aperta il 2 dic 2015

Vedi su GitHub
 (2 commenti) (0 reazioni) (0 assegnatari)JavaScript (2496 fork)batch import
good first issue

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

I need to toggle the visibility of the grid footer by user request, so I basically change the showColumnFooter value then call handleWindowResize and refresh to resize and upgrade the grid. The grid rests inside a div in a full flexible layout with stuff above and below so it's important to adjust the size properly, but something is not working:

  • If the footer is hidden at startup, showing it (i.e. setting showColumnFooter=true) will cause the grid to exceed the container height.
  • If the footer is initially visible instead, hiding it (showColumnFooter=false) will leave an empty space at the bottom.
  • The miscalculated height is persistent: any subsequent call to handleWindowResize and refresh won't fix the problem.

I've made a very simplified version of my layout in this plunkr: by playing with the buttons to toggle the footer and change the container size you can see exactly what the problem is.

Guida contributor