diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2017-03-24 09:22:10 +0200 |
---|---|---|
committer | Henri Sara <henri.sara@gmail.com> | 2017-03-24 09:22:10 +0200 |
commit | 6f1f83d4b95a45db03c5a74ad09b22541fb06e64 (patch) | |
tree | 937465d45919c8e284a8200fb66d490a78052f08 /client | |
parent | 6384bc7dee5ccbaaafbbf569b758b3e6fd8a2c8b (diff) | |
download | vaadin-framework-6f1f83d4b95a45db03c5a74ad09b22541fb06e64.tar.gz vaadin-framework-6f1f83d4b95a45db03c5a74ad09b22541fb06e64.zip |
Fix default header content changes on init (#8921)
This patch also enables an old test that was pending #8128
Fixes vaadin/framework8-issues#556
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java | 26 |
1 files changed, 14 insertions, 12 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 06c4bb0f37..1c457ec4db 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 @@ -308,22 +308,24 @@ public class GridConnector extends AbstractListingConnector */ @OnStateChange("header") void updateHeader() { - final Grid<JsonObject> grid = getWidget(); - final SectionState state = getState().header; + Scheduler.get().scheduleFinally(() -> { + final Grid<JsonObject> grid = getWidget(); + final SectionState state = getState().header; - while (grid.getHeaderRowCount() > 0) { - grid.removeHeaderRow(0); - } + while (grid.getHeaderRowCount() > 0) { + grid.removeHeaderRow(0); + } - for (RowState rowState : state.rows) { - HeaderRow row = grid.appendHeaderRow(); + for (RowState rowState : state.rows) { + HeaderRow row = grid.appendHeaderRow(); - if (rowState.defaultHeader) { - grid.setDefaultHeaderRow(row); - } + if (rowState.defaultHeader) { + grid.setDefaultHeaderRow(row); + } - updateStaticRow(rowState, row); - } + updateStaticRow(rowState, row); + } + }); } private void updateStaticRow(RowState rowState, |