From eb7391b2a27287f22825ecf215480866031cfefb Mon Sep 17 00:00:00 2001 From: Olli Tietäväinen Date: Mon, 9 Jan 2017 08:39:57 +0200 Subject: reopen Grid details on attach, fixes #8015 (#8074) Fixes #8015 --- client/src/main/java/com/vaadin/client/widgets/Grid.java | 8 ++++++++ 1 file changed, 8 insertions(+) mode change 100644 => 100755 client/src/main/java/com/vaadin/client/widgets/Grid.java (limited to 'client') diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java old mode 100644 new mode 100755 index b0735a595e..0ce48820d5 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -4138,6 +4138,8 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, private GridSpacerUpdater gridSpacerUpdater = new GridSpacerUpdater(); /** A set keeping track of the indices of all currently open details */ private Set visibleDetails = new HashSet(); + /** A set of indices of details to reopen after detach and on attach */ + private final Set reattachVisibleDetails = new HashSet(); private boolean columnReorderingAllowed; @@ -8774,11 +8776,17 @@ public class Grid extends ResizeComposite implements HasSelectionHandlers, // Grid was just attached to DOM. Column widths should be calculated. recalculateColumnWidths(); + for (int row : reattachVisibleDetails) { + setDetailsVisible(row, true); + } + reattachVisibleDetails.clear(); } @Override protected void onDetach() { Set details = new HashSet(visibleDetails); + reattachVisibleDetails.clear(); + reattachVisibleDetails.addAll(details); for (int row : details) { setDetailsVisible(row, false); } -- cgit v1.2.3