From b36c0fc7e01def912430be5d9a42d344d8202046 Mon Sep 17 00:00:00 2001 From: Leif Åstrand Date: Wed, 9 Jul 2014 19:20:19 +0300 Subject: GridConnector sends user sort events to the server (#13334) Change-Id: Ic5b1462ecf2e5a5cef6b08bea7a4c00a09c39c9a --- server/src/com/vaadin/ui/components/grid/Grid.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'server') 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 order = new ArrayList( + columnIds.length); + for (int i = 0; i < columnIds.length; i++) { + Object propertyId = getPropertyIdByColumnId(columnIds[i]); + order.add(new SortOrder(propertyId, directions[i])); + } + + setSortOrder(order); + } }); } -- cgit v1.2.3