angular-ui/ui-grid

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

Open

#4 801 ouverte le 2 déc. 2015

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)JavaScript (2 496 forks)batch import
good first issue

Métriques du dépôt

Stars
 (5 395 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

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.

Guide contributeur