aboutsummaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorOlli Tietäväinen <ollit@vaadin.com>2017-01-09 08:39:57 +0200
committerDenis <denis@vaadin.com>2017-01-09 08:39:57 +0200
commiteb7391b2a27287f22825ecf215480866031cfefb (patch)
treee7ba88245ead4bdce1b93d643f044398ebe75556 /client
parentdcba507ab4e13299f8c309529fd413520cb1664f (diff)
downloadvaadin-framework-eb7391b2a27287f22825ecf215480866031cfefb.tar.gz
vaadin-framework-eb7391b2a27287f22825ecf215480866031cfefb.zip
reopen Grid details on attach, fixes #8015 (#8074)
Fixes #8015
Diffstat (limited to 'client')
-rwxr-xr-x[-rw-r--r--]client/src/main/java/com/vaadin/client/widgets/Grid.java8
1 files changed, 8 insertions, 0 deletions
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 b0735a595e..0ce48820d5 100644..100755
--- 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<T> extends ResizeComposite implements HasSelectionHandlers<T>,
private GridSpacerUpdater gridSpacerUpdater = new GridSpacerUpdater();
/** A set keeping track of the indices of all currently open details */
private Set<Integer> visibleDetails = new HashSet<Integer>();
+ /** A set of indices of details to reopen after detach and on attach */
+ private final Set<Integer> reattachVisibleDetails = new HashSet<Integer>();
private boolean columnReorderingAllowed;
@@ -8774,11 +8776,17 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>,
// 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<Integer> details = new HashSet<Integer>(visibleDetails);
+ reattachVisibleDetails.clear();
+ reattachVisibleDetails.addAll(details);
for (int row : details) {
setDetailsVisible(row, false);
}