summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJohannes Dahlström <johannesd@vaadin.com>2015-09-29 18:51:36 +0300
committerJohannes Dahlström <johannesd@vaadin.com>2015-10-08 13:23:38 +0300
commit5eee3acc26ba05d4e3d82d43c1f3e937384d32cb (patch)
tree05e8f038c3a33c5c79aabed91723f2ffc93dc3f1 /client
parented5b1f2c279c37ba80da179f92fd66a4e43342f9 (diff)
downloadvaadin-framework-5eee3acc26ba05d4e3d82d43c1f3e937384d32cb.tar.gz
vaadin-framework-5eee3acc26ba05d4e3d82d43c1f3e937384d32cb.zip
Report user-resized column widths to server (#16838)
Change-Id: Id53bab75688ab7f01d6b64f679d2a40e03714c97
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/connectors/GridConnector.java8
-rw-r--r--client/src/com/vaadin/client/ui/dd/DragHandle.java3
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java13
3 files changed, 18 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/connectors/GridConnector.java b/client/src/com/vaadin/client/connectors/GridConnector.java
index 82fe3d9279..60a9aacb88 100644
--- a/client/src/com/vaadin/client/connectors/GridConnector.java
+++ b/client/src/com/vaadin/client/connectors/GridConnector.java
@@ -193,6 +193,14 @@ public class GridConnector extends AbstractHasComponentsConnector implements
return null;
}
+ @Override
+ protected void setWidth(double pixels, boolean userOriginated) {
+ super.setWidth(pixels, userOriginated);
+ if (userOriginated) {
+ getRpcProxy(GridServerRpc.class).columnResized(id, pixels);
+ }
+ }
+
private AbstractFieldConnector getEditorConnector() {
return editorConnector;
}
diff --git a/client/src/com/vaadin/client/ui/dd/DragHandle.java b/client/src/com/vaadin/client/ui/dd/DragHandle.java
index c3a0768a72..ef4f94d18f 100644
--- a/client/src/com/vaadin/client/ui/dd/DragHandle.java
+++ b/client/src/com/vaadin/client/ui/dd/DragHandle.java
@@ -127,8 +127,7 @@ public class DragHandle {
@Override
public void onDragEnd() {
- removeDraggingStyle();
- userCallback.onComplete();
+ // NOP, handled in onDrop and onDragCancel
}
@Override
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 1e1c89234b..e01edcddd7 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -2798,6 +2798,7 @@ public class Grid<T> extends ResizeComposite implements
setWidth(-1);
setEditable(false);
+ setResizable(false);
initDone = true;
}
@@ -4759,13 +4760,17 @@ public class Grid<T> extends ResizeComposite implements
* the width in pixels or negative for auto sizing
*/
public Column<C, T> setWidth(double pixels) {
+ setWidth(pixels, false);
+ return this;
+ }
+
+ protected void setWidth(double pixels, boolean userOriginated) {
if (!WidgetUtil.pixelValuesEqual(widthUser, pixels)) {
widthUser = pixels;
if (!isHidden()) {
scheduleColumnWidthRecalculator();
}
}
- return this;
}
void doSetWidth(double pixels) {
@@ -5572,7 +5577,7 @@ public class Grid<T> extends ResizeComposite implements
@Override
public void onUpdate(double deltaX,
double deltaY) {
- col.setWidth(initialWidth + deltaX);
+ col.setWidth(initialWidth + deltaX, false);
}
@Override
@@ -5582,12 +5587,12 @@ public class Grid<T> extends ResizeComposite implements
@Override
public void onComplete() {
- // NOP
+ col.setWidth(col.getWidthActual(), true);
}
@Override
public void onCancel() {
- col.setWidth(initialWidth);
+ col.setWidth(initialWidth, false);
}
});
dragger.addTo(td);