diff options
author | Leif Åstrand <leif@vaadin.com> | 2014-07-09 19:20:19 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2014-07-10 12:11:35 +0000 |
commit | b36c0fc7e01def912430be5d9a42d344d8202046 (patch) | |
tree | 840564175a2176ac7bd512ab0df6980d2133104e /server | |
parent | 2ef88966831c2bc64e5be645ff3bda2adb58f70a (diff) | |
download | vaadin-framework-b36c0fc7e01def912430be5d9a42d344d8202046.tar.gz vaadin-framework-b36c0fc7e01def912430be5d9a42d344d8202046.zip |
GridConnector sends user sort events to the server (#13334)
Change-Id: Ic5b1462ecf2e5a5cef6b08bea7a4c00a09c39c9a
Diffstat (limited to 'server')
-rw-r--r-- | server/src/com/vaadin/ui/components/grid/Grid.java | 14 |
1 files changed, 14 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 1d9cb8ef10..cc284841a1 100644 --- a/server/src/com/vaadin/ui/components/grid/Grid.java +++ b/server/src/com/vaadin/ui/components/grid/Grid.java @@ -315,6 +315,20 @@ public class Grid extends AbstractComponent implements SelectionChangeNotifier { } } } + + @Override + public void sort(String[] columnIds, SortDirection[] directions) { + assert columnIds.length == directions.length; + + List<SortOrder> order = new ArrayList<SortOrder>( + columnIds.length); + for (int i = 0; i < columnIds.length; i++) { + Object propertyId = getPropertyIdByColumnId(columnIds[i]); + order.add(new SortOrder(propertyId, directions[i])); + } + + setSortOrder(order); + } }); } |