From cef5f15132730a4a9a89061c5c2d74d0d580beaa Mon Sep 17 00:00:00 2001 From: Vitaly Litvak Date: Tue, 28 Apr 2015 10:41:37 +0300 Subject: [PATCH] For #156 - fixed issue with scroll bar space in grid --- .../traccar/web/client/view/UserDialog.java | 25 ++++++++++++++++--- .../traccar/web/client/view/UserDialog.ui.xml | 5 +--- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/traccar/web/client/view/UserDialog.java b/src/main/java/org/traccar/web/client/view/UserDialog.java index 251767bf..dcdf4760 100644 --- a/src/main/java/org/traccar/web/client/view/UserDialog.java +++ b/src/main/java/org/traccar/web/client/view/UserDialog.java @@ -19,10 +19,7 @@ import com.sencha.gxt.core.client.ToStringValueProvider; import com.sencha.gxt.data.shared.ListStore; import com.sencha.gxt.widget.core.client.form.validator.RegExValidator; -import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel; -import com.sencha.gxt.widget.core.client.grid.ColumnConfig; -import com.sencha.gxt.widget.core.client.grid.ColumnModel; -import com.sencha.gxt.widget.core.client.grid.Grid; +import com.sencha.gxt.widget.core.client.grid.*; import org.traccar.web.client.ApplicationContext; import org.traccar.web.client.i18n.Messages; import org.traccar.web.client.model.EnumKeyProvider; @@ -86,6 +83,9 @@ public interface UserHandler { @UiField Grid grid; + @UiField(provided = true) + GridView view; + @UiField(provided = true) ColumnModel columnModel; @@ -95,6 +95,19 @@ public interface UserHandler { @UiField(provided = true) Messages i18n = GWT.create(Messages.class); + static class NoScrollbarGridView extends GridView { + public NoScrollbarGridView() { + this.scrollOffset = 1; + this.vbar = false; + this.setAdjustForHScroll(false); + } + + @Override + protected int getScrollAdjust() { + return 0; + } + } + public UserDialog(User user, UserHandler userHandler) { this.userHandler = userHandler; @@ -114,6 +127,10 @@ public String getValue(DeviceEventType object) { columnModel = new ColumnModel(columns); + view = new NoScrollbarGridView(); + view.setAutoFill(true); + view.setStripeRows(true); + notificationEventStore = new ListStore(new EnumKeyProvider()); notificationEventStore.addAll(Arrays.asList(DeviceEventType.values())); diff --git a/src/main/java/org/traccar/web/client/view/UserDialog.ui.xml b/src/main/java/org/traccar/web/client/view/UserDialog.ui.xml index e84457f5..0ca3e759 100644 --- a/src/main/java/org/traccar/web/client/view/UserDialog.ui.xml +++ b/src/main/java/org/traccar/web/client/view/UserDialog.ui.xml @@ -11,10 +11,7 @@ - - - - +