diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2018-10-08 15:08:05 +0300 |
---|---|---|
committer | Sun Zhe <31067185+ZheSun88@users.noreply.github.com> | 2018-10-08 15:08:05 +0300 |
commit | a174deeac87899960f136f4675f9146785da2413 (patch) | |
tree | bcc0476ec5cf5253bd1dba6e547d0310dec894f4 /compatibility-client | |
parent | 24c45ba8f1b0cdc7d0d6ce9e23f23f9b65d15a4a (diff) | |
download | vaadin-framework-a174deeac87899960f136f4675f9146785da2413.tar.gz vaadin-framework-a174deeac87899960f136f4675f9146785da2413.zip |
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
Diffstat (limited to 'compatibility-client')
3 files changed, 17 insertions, 17 deletions
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 @@ -221,6 +221,22 @@ public interface RowContainer { public int getRowCount(); /** + * This method calculates the current row count directly from the DOM. + * <p> + * 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. + * <p> + * 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. * * @param px 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 @@ -1291,22 +1291,6 @@ public class Escalator extends Widget } /** - * This method calculates the current row count directly from the DOM. - * <p> - * 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. - * <p> - * 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} * <p> * <em>Implementation detail:</em> This method does no DOM modifications 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<T> extends ResizeComposite implements HasSelectionHandlers<T>, 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"); |