summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2019-10-22 13:55:27 +0300
committerOlli Tietäväinen <ollit@vaadin.com>2019-10-22 13:55:27 +0300
commit3980e35b71f9f20bf812123de8f017398927ff46 (patch)
tree54536dd73dea4727006bf3378b85252f54e65a2c /client
parentbb9473e77c00f1fdda9eb4fdbbbeefbf985a3e8f (diff)
downloadvaadin-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.java12
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();
}