angular-ui/ui-grid

autoAdjustHeight - expose on api?

Open

#4,831 opened on 2015年12月9日

GitHub で見る
 (1 comment) (1 reaction) (0 assignees)JavaScript (2,496 forks)batch import
good first issue

Repository metrics

Stars
 (5,395 stars)
PR merge metrics
 (30d に merged PR はありません)

説明

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?

コントリビューターガイド