summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorHenri Sara <henri.sara@gmail.com>2017-03-29 11:18:07 +0300
committerPekka Hyvönen <pekka@vaadin.com>2017-03-29 11:18:07 +0300
commitf9a9f2c4be0e38d936acab88cba45799fa83ff4a (patch)
tree59d2d5bbeb39ce2c942981c112e9a4bd3c6fed8d /client
parent92ccddf4f2465dae1f43e6087ca25ae41cae637d (diff)
downloadvaadin-framework-f9a9f2c4be0e38d936acab88cba45799fa83ff4a.tar.gz
vaadin-framework-f9a9f2c4be0e38d936acab88cba45799fa83ff4a.zip
Add Grid.setRowHeight() (#8935)
Fixes #8667
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java14
1 files changed, 14 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java
index 1c457ec4db..c7b759c7fb 100644
--- a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java
+++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java
@@ -328,6 +328,20 @@ public class GridConnector extends AbstractListingConnector
});
}
+ @OnStateChange("rowHeight")
+ void updateRowHeight() {
+ double rowHeight = getState().rowHeight;
+ if (rowHeight >= 0) {
+ getWidget().getEscalator().getHeader()
+ .setDefaultRowHeight(rowHeight);
+ getWidget().getEscalator().getBody().setDefaultRowHeight(rowHeight);
+ getWidget().getEscalator().getFooter()
+ .setDefaultRowHeight(rowHeight);
+ } else if (getWidget().isAttached()) {
+ getWidget().resetSizesFromDom();
+ }
+ }
+
private void updateStaticRow(RowState rowState,
Grid.StaticSection.StaticRow row) {
rowState.cells.forEach((columnId, cellState) -> {