diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2019-10-22 13:55:27 +0300 |
---|---|---|
committer | Olli Tietäväinen <ollit@vaadin.com> | 2019-10-22 13:55:27 +0300 |
commit | 3980e35b71f9f20bf812123de8f017398927ff46 (patch) | |
tree | 54536dd73dea4727006bf3378b85252f54e65a2c /client | |
parent | bb9473e77c00f1fdda9eb4fdbbbeefbf985a3e8f (diff) | |
download | vaadin-framework-3980e35b71f9f20bf812123de8f017398927ff46.tar.gz vaadin-framework-3980e35b71f9f20bf812123de8f017398927ff46.zip |
Make sure expanding/collapsing updates expected cache size. (#11753)
* Make sure expanding/collapsing updates expected cache size.
Fixes #11749
* Merge branch 'master' into issue11749
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java b/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java index b1d60734e8..c220057508 100644 --- a/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java +++ b/client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java @@ -203,6 +203,12 @@ public class TreeGridConnector extends GridConnector { public void dataRemoved(int firstRowIndex, int numberOfRows) { if (awaitingRowsState == AwaitingRowsState.COLLAPSE) { awaitingRowsState = AwaitingRowsState.NONE; + // make sure the cache stays up to date with the collapsing + Range visibleRowRange = getWidget().getEscalator() + .getVisibleRowRange(); + getDataSource().ensureAvailability( + visibleRowRange.getStart(), + visibleRowRange.getEnd()); } checkExpand(); } @@ -211,6 +217,12 @@ public class TreeGridConnector extends GridConnector { public void dataAdded(int firstRowIndex, int numberOfRows) { if (awaitingRowsState == AwaitingRowsState.EXPAND) { awaitingRowsState = AwaitingRowsState.NONE; + // make sure the cache stays up to date with the expanding + Range visibleRowRange = getWidget().getEscalator() + .getVisibleRowRange(); + getDataSource().ensureAvailability( + visibleRowRange.getStart(), + visibleRowRange.getEnd()); } checkExpand(); } |