From c7b66c62580296abbbc743b0300378480ac4610e Mon Sep 17 00:00:00 2001 From: Matti Tahvonen Date: Thu, 28 Jun 2007 05:15:29 +0000 Subject: [PATCH] fixed headers width and added horizontal scrollhandler to adjust headers position svn changeset:1796/svn branch:trunk --- .../terminal/gwt/client/ui/scrolltable/IScrollTable.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java b/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java index 3a78a1a94e..4bb7b08193 100644 --- a/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java +++ b/src/com/itmill/toolkit/terminal/gwt/client/ui/scrolltable/IScrollTable.java @@ -230,6 +230,11 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll rowRequestHandler.cancel(); + // fix headers horizontal scrolling + System.out.println("scrolling header to " + scrollLeft); + headerContainer.setHorizontalScrollPosition(scrollLeft); + + firstRowInViewPort = (int) Math.ceil( scrollTop / tBody.getRowHeight() ); client.console.log("At scrolltop: " + scrollTop + " At row " + firstRowInViewPort); @@ -273,6 +278,7 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll rowRequestHandler.setReqRows((int) ((firstRowInViewPort + pageLength + pageLength*CACHE_RATE) - lastRendered)); rowRequestHandler.deferRowFetch(); } + } @@ -292,8 +298,10 @@ public class IScrollTable extends Composite implements Paintable, ITable, Scroll if(width < 0) { bodyContainer.setWidth((tBody.getOffsetWidth() + getScrollBarWidth() ) + "px"); + headerContainer.setWidth((tBody.getOffsetWidth()) + "px"); } else { bodyContainer.setWidth(width + "px"); + headerContainer.setWidth(width + "px"); } if(firstvisible > 0) -- 2.39.5