From a174deeac87899960f136f4675f9146785da2413 Mon Sep 17 00:00:00 2001 From: Anna Koskinen Date: Mon, 8 Oct 2018 15:08:05 +0300 Subject: Fixes to displaying Grid in a detail row. (#11147) - Multiple headers shouldn't stack behind each other. - Body rows shouldn't get stuck to default row height. - Compatibility version's hidable row selector shouldn't try to calculate row heights based on rows that haven't been added to DOM yet. Fixes #7674 --- .../vaadin/v7/client/widget/escalator/RowContainer.java | 16 ++++++++++++++++ .../java/com/vaadin/v7/client/widgets/Escalator.java | 16 ---------------- .../src/main/java/com/vaadin/v7/client/widgets/Grid.java | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'compatibility-client') diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/RowContainer.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/RowContainer.java index 5e3ac96efd..c9c5dfb903 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/RowContainer.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/RowContainer.java @@ -220,6 +220,22 @@ public interface RowContainer { */ public int getRowCount(); + /** + * This method calculates the current row count directly from the DOM. + *

+ * While the container is stable, this value should equal to + * {@link #getRowCount()}, but while row counts are being updated, these two + * values might differ for a short while. + *

+ * Any extra content, such as spacers for the body, should not be included + * in this count. + * + * @since + * + * @return the actual DOM count of rows + */ + public int getDomRowCount(); + /** * The default height of the rows in this RowContainer. * diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java index 70689b2482..e50682f2c1 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Escalator.java @@ -1290,22 +1290,6 @@ public class Escalator extends Widget return rows; } - /** - * This method calculates the current row count directly from the DOM. - *

- * While Escalator is stable, this value should equal to - * {@link #getRowCount()}, but while row counts are being updated, these - * two values might differ for a short while. - *

- * Any extra content, such as spacers for the body, should not be - * included in this count. - * - * @since 7.5.0 - * - * @return the actual DOM count of rows - */ - public abstract int getDomRowCount(); - /** * {@inheritDoc} *

diff --git a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java index 5ab014d413..8af5818eb1 100644 --- a/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java +++ b/compatibility-client/src/main/java/com/vaadin/v7/client/widgets/Grid.java @@ -3936,7 +3936,7 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private void setHeightToHeaderCellHeight() { RowContainer header = grid.escalator.getHeader(); - if (header.getRowCount() == 0 + if (header.getDomRowCount() == 0 || !header.getRowElement(0).hasChildNodes()) { getLogger().info( "No header cell available when calculating sidebar button height"); -- cgit v1.2.3