diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-05-15 15:10:59 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-05-16 07:43:56 +0300 |
commit | f7ca6cbe295974aa8dd175c8abd3b36b34d0b58e (patch) | |
tree | 0d79f93e1b7fcaba2edea2b8fb3554025be82c5b /server/src/main/java/com/vaadin/ui | |
parent | 84e06c864592782393765b142802b608b8874b7e (diff) | |
download | vaadin-framework-8.4.2.tar.gz vaadin-framework-8.4.2.zip |
Fix Grid clearSortOrder not updating state (#10917)8.4.2
Fixes #9074
Diffstat (limited to 'server/src/main/java/com/vaadin/ui')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/Grid.java | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/server/src/main/java/com/vaadin/ui/Grid.java b/server/src/main/java/com/vaadin/ui/Grid.java index 887a43f5c8..e78733701c 100644 --- a/server/src/main/java/com/vaadin/ui/Grid.java +++ b/server/src/main/java/com/vaadin/ui/Grid.java @@ -4111,8 +4111,7 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, * Clear the current sort order, and re-sort the grid. */ public void clearSortOrder() { - sortOrder.clear(); - sort(false); + setSortOrder(Collections.emptyList()); } /** @@ -4721,14 +4720,6 @@ public class Grid<T> extends AbstractListing<T> implements HasComponents, getState().sortDirs = directions.toArray(new SortDirection[0]); sortOrder.clear(); - if (order.isEmpty()) { - // Grid is not sorted anymore. - getDataCommunicator().setBackEndSorting(Collections.emptyList()); - getDataCommunicator().setInMemorySorting(null); - fireEvent(new SortEvent<>(this, new ArrayList<>(sortOrder), - userOriginated)); - return; - } sortOrder.addAll(order); sort(userOriginated); } |