summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorAleksi Hietanen <aleksi@vaadin.com>2016-09-19 17:01:20 +0300
committerDenis Anisimov <denis@vaadin.com>2016-09-20 11:23:53 +0000
commit79132bcb6d498322ce8cb0f554658f96b13b29d9 (patch)
treeefe187599b0825d20c7e3812fd9110b911e03c77 /client
parent8939d3257f2f48ce5525b908c3d3450cee837aaf (diff)
downloadvaadin-framework-79132bcb6d498322ce8cb0f554658f96b13b29d9.tar.gz
vaadin-framework-79132bcb6d498322ce8cb0f554658f96b13b29d9.zip
Reintroduce grid column hiding
Change-Id: I8a0344dffe3f2ef84f8134e05d9b7340d9b603a0
Diffstat (limited to 'client')
-rw-r--r--client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java15
-rw-r--r--client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java7
2 files changed, 22 insertions, 0 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java
index 3805e01370..d88a50b7e5 100644
--- a/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java
+++ b/client/src/main/java/com/vaadin/client/connectors/grid/ColumnConnector.java
@@ -80,6 +80,21 @@ public class ColumnConnector extends AbstractExtensionConnector {
column.setSortable(getState().sortable);
}
+ @OnStateChange("hidingToggleCaption")
+ void updateHidingToggleCaption() {
+ column.setHidingToggleCaption(getState().hidingToggleCaption);
+ }
+
+ @OnStateChange("hidden")
+ void updateHidden() {
+ column.setHidden(getState().hidden);
+ }
+
+ @OnStateChange("hidable")
+ void updateHidable() {
+ column.setHidable(getState().hidable);
+ }
+
@Override
public void onUnregister() {
super.onUnregister();
diff --git a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java
index 58a5ea8262..fd31622cfe 100644
--- a/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java
+++ b/client/src/main/java/com/vaadin/client/connectors/grid/GridConnector.java
@@ -157,6 +157,13 @@ public class GridConnector
return null;
});
+ getWidget().addColumnVisibilityChangeHandler(event -> {
+ if (event.isUserOriginated()) {
+ getRpcProxy(GridServerRpc.class).columnVisibilityChanged(
+ getColumnId(event.getColumn()), event.isHidden());
+ }
+ });
+
/* Item click events */
getWidget().addBodyClickHandler(itemClickHandler);
getWidget().addBodyDoubleClickHandler(itemClickHandler);