angular-ui/ui-grid

autoAdjustHeight - expose on api?

Open

#4 831 ouverte le 9 déc. 2015

Voir sur GitHub
 (1 commentaire) (1 réaction) (0 assignés)JavaScript (2 496 forks)batch import
good first issue

Métriques du dépôt

Stars
 (5 395 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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?

Guide contributeur