diff options
author | Artur <artur@vaadin.com> | 2017-12-28 09:58:19 +0200 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-12-28 09:58:19 +0200 |
commit | d9a0e1c22f87c64b95bd52ca933534f35f805158 (patch) | |
tree | caa865d6eebafb8a24e56f89f42a325346dd82e0 | |
parent | c95055e06027742750c1104c5b30442709831d79 (diff) | |
download | vaadin-framework-d9a0e1c22f87c64b95bd52ca933534f35f805158.tar.gz vaadin-framework-d9a0e1c22f87c64b95bd52ca933534f35f805158.zip |
Do not create DOM elements for initially hidden columns (#10465)
-rw-r--r-- | client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java | 1 | ||||
-rwxr-xr-x | client/src/main/java/com/vaadin/client/widgets/Grid.java | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java index be1734a269..1737f90210 100644 --- a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java @@ -108,6 +108,7 @@ public class ColumnConnector extends AbstractExtensionConnector { // Initially set a renderer updateRenderer(); + updateHidden(); getParent().addColumn(column, getState().internalId); diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index 38cdfa4c3d..d8f0e12b76 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -5131,6 +5131,12 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, private void setHidden(boolean hidden, boolean userOriginated) { if (this.hidden != hidden) { + if (grid == null) { + // Not yet attached so just update the flag so that a column + // can initially be hidden + this.hidden = hidden; + return; + } if (hidden) { grid.escalator.getColumnConfiguration().removeColumns( grid.getVisibleColumns().indexOf(this), 1); |