Browse Source

Fixes a bug with frozen columns, and adding/removing them (#12645)

Change-Id: I7b085d1113c4f21c5b494dde97c45d728e0ea4a0
tags/7.2.0.beta1
Henrik Paul 10 years ago
parent
commit
11766b43d7
1 changed files with 13 additions and 10 deletions
  1. 13
    10
      client/src/com/vaadin/client/ui/grid/Escalator.java

+ 13
- 10
client/src/com/vaadin/client/ui/grid/Escalator.java View File

hScrollbarStyle.clearRight(); 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. // we might've got new or got rid of old scrollbars.
recalculateTableWrapperSize(); recalculateTableWrapperSize();
} }
} }
} }


/*
* 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(); scroller.recalculateScrollbarsForVirtualViewport();
horizontalScrollbar.setScrollPos(scrollPos);
} }


@Override @Override

Loading…
Cancel
Save