angular-ui/ui-grid

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

Open

#4,801 建立於 2015年12月2日

在 GitHub 查看
 (2 留言) (0 反應) (0 負責人)JavaScript (5,395 star) (2,496 fork)batch import
good first issue

描述

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.

貢獻者指南