angular-ui/ui-grid

autoAdjustHeight - expose on api?

Open

#4,831 opened on Dec 9, 2015

View on GitHub
 (1 comment) (1 reaction) (0 assignees)JavaScript (5,395 stars) (2,496 forks)batch import
good first issue

Description

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?

Contributor guide