diff options
author | Henrik Paul <henrik@vaadin.com> | 2013-11-26 10:35:00 +0200 |
---|---|---|
committer | Henrik Paul <henrik@vaadin.com> | 2013-11-26 10:35:00 +0200 |
commit | 11766b43d7fd5908e5cb19a051d383a9506e3c30 (patch) | |
tree | cbc9e4d7958f5b2f41fd8a633ce169eb46ad0510 | |
parent | 48045b06c90d0b88f431ddd075e1e7774e614bf6 (diff) | |
download | vaadin-framework-11766b43d7fd5908e5cb19a051d383a9506e3c30.tar.gz vaadin-framework-11766b43d7fd5908e5cb19a051d383a9506e3c30.zip |
Fixes a bug with frozen columns, and adding/removing them (#12645)
Change-Id: I7b085d1113c4f21c5b494dde97c45d728e0ea4a0
-rw-r--r-- | client/src/com/vaadin/client/ui/grid/Escalator.java | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/client/src/com/vaadin/client/ui/grid/Escalator.java b/client/src/com/vaadin/client/ui/grid/Escalator.java index 540676653e..431b8715ad 100644 --- a/client/src/com/vaadin/client/ui/grid/Escalator.java +++ b/client/src/com/vaadin/client/ui/grid/Escalator.java @@ -597,6 +597,19 @@ public class Escalator extends Widget { hScrollbarStyle.clearRight(); } + /* + * If decreasing the amount of frozen columns, and scrolled to the + * right, the scroll position will reset. So we need to remember the + * scroll position, and re-apply it once the scrollbar size has been + * adjusted. + */ + final int scrollPos = horizontalScrollbar.getScrollPos(); + final int leftPos = getColumnConfiguration().getFrozenColumnCount() + * COLUMN_WIDTH_PX; + horizontalScrollbar.getElement().getStyle() + .setLeft(leftPos, Unit.PX); + horizontalScrollbar.setScrollPos(scrollPos); + // we might've got new or got rid of old scrollbars. recalculateTableWrapperSize(); } @@ -2581,17 +2594,7 @@ public class Escalator extends Widget { } } - /* - * If decreasing the amount of frozen columns, and scrolled to the - * right, the scroll position will reset. So we need to remember the - * scroll position, and re-apply it once the scrollbar size has been - * adjusted. - */ - int scrollPos = horizontalScrollbar.getScrollPos(); - horizontalScrollbar.getElement().getStyle() - .setLeft(frozenColumns * COLUMN_WIDTH_PX, Unit.PX); scroller.recalculateScrollbarsForVirtualViewport(); - horizontalScrollbar.setScrollPos(scrollPos); } @Override |