angular-ui/ui-grid

autoAdjustHeight - expose on api?

Open

#4831 aperta il 9 dic 2015

Vedi su GitHub
 (1 commento) (1 reazione) (0 assegnatari)JavaScript (2496 fork)batch import
good first issue

Metriche repository

Star
 (5395 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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?

Guida contributor