summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAnna Koskinen <Ansku@users.noreply.github.com>2021-08-20 14:27:18 +0300
committerGitHub <noreply@github.com>2021-08-20 14:27:18 +0300
commit7c666980c0dabcf6f3dbcd0e395b5cbdec024dc7 (patch)
tree2fa6a97cc9a49afa67057d1695ca8560fe3ff7f2 /client
parent029f47f1faaa9fd421e01b3b7fc664faf0fcae8f (diff)
downloadvaadin-framework-7c666980c0dabcf6f3dbcd0e395b5cbdec024dc7.tar.gz
vaadin-framework-7c666980c0dabcf6f3dbcd0e395b5cbdec024dc7.zip
Updates to TreeGrid's ensureAvailability handling. (#12374)
- Always update the availability request range when more or less data becomes available. Otherwise e.g. programmatically expanding a TreeGrid row can lead to discarding a lot of the new data right after receiving it. Fixes #12372
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/ui/treegrid/TreeGridConnector.java24
1 files changed, 11 insertions, 13 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 7c2475dd09..2172ee1d0f 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
@@ -207,13 +207,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.length());
}
+ // make sure the cache stays up to date
+ Range visibleRowRange = getWidget().getEscalator()
+ .getVisibleRowRange();
+ getDataSource().ensureAvailability(visibleRowRange.getStart(),
+ visibleRowRange.length());
checkExpand();
}
@@ -221,13 +220,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.length());
}
+ // make sure the cache stays up to date
+ Range visibleRowRange = getWidget().getEscalator()
+ .getVisibleRowRange();
+ getDataSource().ensureAvailability(visibleRowRange.getStart(),
+ visibleRowRange.length());
checkExpand();
}
@@ -252,7 +250,7 @@ public class TreeGridConnector extends GridConnector {
GridEventHandler<?> eventHandler)
/*-{
var browserEventHandlers = grid.@com.vaadin.client.widgets.Grid::browserEventHandlers;
-
+
// FocusEventHandler is initially 5th in the list of browser event handlers
browserEventHandlers.@java.util.List::set(*)(5, eventHandler);
}-*/;