]> source.dussan.org Git - vaadin-framework.git/commitdiff
Minor IScrolltable fixes. Extra scrollbar space in some situations and table height...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 29 Apr 2009 08:11:09 +0000 (08:11 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Wed, 29 Apr 2009 08:11:09 +0000 (08:11 +0000)
svn changeset:7559/svn branch:6.0

src/com/itmill/toolkit/terminal/gwt/client/ui/IScrollTable.java

index 70bcc618a5a639802898b92d8dbe21babd6745fb..596b47a1919a27a6f314941b402ce82ac1e3a2e8 100644 (file)
@@ -15,7 +15,6 @@ import java.util.Vector;
 
 import com.google.gwt.dom.client.Document;
 import com.google.gwt.dom.client.NodeList;
-import com.google.gwt.dom.client.Style;
 import com.google.gwt.dom.client.TableCellElement;
 import com.google.gwt.dom.client.TableRowElement;
 import com.google.gwt.dom.client.TableSectionElement;
@@ -687,10 +686,12 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
              */
             if (pageLength == totalRows) {
                 /*
-                 * We want to show all rows so the bodyHeight should be equal to
-                 * the table height
+                 * A hack to support variable height rows when paging is off.
+                 * Generally this is not supported by scrolltable. We want to
+                 * show all rows so the bodyHeight should be equal to the table
+                 * height.
                  */
-                int bodyHeight = tBody.getTableHeight();
+                int bodyHeight = tBody.getOffsetHeight();
                 bodyContainer.setHeight(bodyHeight + "px");
                 Util.runWebkitOverflowAutoFix(bodyContainer.getElement());
             } else {
@@ -1838,12 +1839,8 @@ public class IScrollTable extends FlowPanel implements Table, ScrollListener {
         }
 
         public int getAvailableWidth() {
-            Style style = bodyContainer.getElement().getStyle();
-            style.setProperty("overflow", "hidden");
-            int w = bodyContainer.getElement().getPropertyInt("clientWidth");
-            style.setProperty("overflow", "auto");
-            return w;
-            // return preSpacer.getOffsetWidth();
+            int availW = bodyContainer.getOffsetWidth() - getBorderWidth();
+            return availW;
         }
 
         public void renderInitialRows(UIDL rowData, int firstIndex, int rows) {