angular-ui/ui-grid

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

Open

#4.801 geöffnet am 2. Dez. 2015

Auf GitHub ansehen
 (2 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (2.496 Forks)batch import
good first issue

Repository-Metriken

Stars
 (5.395 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide