diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-09-26 14:36:16 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2014-10-02 05:31:26 +0000 |
commit | d1e1ecef82adc47882dc5fe3636bf48c8ed6dcc1 (patch) | |
tree | c9a9a89f8aa63162cbea24e2733361575c303e2b /server | |
parent | 5c5d98acb55ed2a12f2de4b43f518f60ab68b058 (diff) | |
download | vaadin-framework-d1e1ecef82adc47882dc5fe3636bf48c8ed6dcc1.tar.gz vaadin-framework-d1e1ecef82adc47882dc5fe3636bf48c8ed6dcc1.zip |
Update sortable columns on property set change (#13334)
Change-Id: I01e74825e5ba68fb3a5e6f68acf8ba7fbde97cf2
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/components/grid/Grid.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/server/src/com/vaadin/ui/components/grid/Grid.java b/server/src/com/vaadin/ui/components/grid/Grid.java index 03d21816b5..9170b712d0 100644 --- a/server/src/com/vaadin/ui/components/grid/Grid.java +++ b/server/src/com/vaadin/ui/components/grid/Grid.java @@ -26,6 +26,7 @@ import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Map.Entry; import com.google.gwt.thirdparty.guava.common.collect.Sets; import com.google.gwt.thirdparty.guava.common.collect.Sets.SetView; @@ -239,6 +240,16 @@ public class Grid extends AbstractComponent implements SelectionChangeNotifier, if (!columns.containsKey(frozenPropertyId)) { setLastFrozenPropertyId(null); } + + // Update sortable columns + if (event.getContainer() instanceof Sortable) { + Collection<?> sortableProperties = ((Sortable) event + .getContainer()).getSortableContainerPropertyIds(); + for (Entry<Object, GridColumn> columnEntry : columns.entrySet()) { + columnEntry.getValue().setSortable( + sortableProperties.contains(columnEntry.getKey())); + } + } } }; |