angular-ui/ui-grid

autoAdjustHeight - expose on api?

Open

#4,831 创建于 2015年12月9日

在 GitHub 查看
 (1 评论) (1 反应) (0 负责人)JavaScript (5,395 star) (2,496 fork)batch import
good first issue

描述

I need to adjust the height of the grid based on the number of rows in my datasource. For example, set the height of the grid to the actual number of rows if less than 10, otherwise only show 10 and have the vertical scrollbar.

This behavior is easily accomplished using the minRowsToShow property. However, the grid doesn't respond to changes to the property after it is initialized.

Inside the compile function, autoAdjustHeight is called. I have fixed this by adding the autoAdjustHeight to the public api. Then I can call autoAdjustHeight when my datasource changes and I've updated the minRowstoShow property.

Is there a better way to accomplish this? Or should I submit a pull request with this api change?

贡献者指南