summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorArtur Signell <artur.signell@itmill.com>2009-09-01 07:05:43 +0000
committerArtur Signell <artur.signell@itmill.com>2009-09-01 07:05:43 +0000
commit39ee85c823ecab75760e4f9768e003cf60b7e796 (patch)
tree7f8960c43e401ac28f24796906be8cbd984a9234 /src/com
parent9e46099987a6c93478afdaab6d47f6187057ed40 (diff)
downloadvaadin-framework-39ee85c823ecab75760e4f9768e003cf60b7e796.tar.gz
vaadin-framework-39ee85c823ecab75760e4f9768e003cf60b7e796.zip
Performance improvement for #2998 - Table rendering in Firefox is very slow when the table contains components
svn changeset:8600/svn branch:6.1
Diffstat (limited to 'src/com')
-rw-r--r--src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
index 7396aa35c9..1409ae9b8f 100644
--- a/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
+++ b/src/com/vaadin/terminal/gwt/client/ui/VScrollTable.java
@@ -286,6 +286,8 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
if (isAttached()) {
sizeInit();
}
+
+ restoreRowVisibility();
}
if (selectMode == Table.SELECT_MODE_NONE) {
@@ -300,6 +302,18 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
headerChangedDuringUpdate = false;
}
+ private void restoreRowVisibility() {
+ // Restore row visibility which is set to "none" when the row is
+ // rendered.
+ TableSectionElement tableBodyElement = scrollBody.tBodyElement;
+ final int rows = tableBodyElement.getChildCount();
+ for (int row = 0; row < rows; row++) {
+ final Element cell = tableBodyElement.getChild(row).cast();
+ cell.getStyle().setProperty("visibility", "");
+ }
+
+ }
+
private void setCacheRate(double d) {
if (cache_rate != d) {
cache_rate = d;
@@ -413,6 +427,7 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
}
scrollBody.fixSpacers();
+ restoreRowVisibility();
}
/**
@@ -2211,6 +2226,12 @@ public class VScrollTable extends FlowPanel implements Table, ScrollHandler {
public VScrollTableRow(UIDL uidl, char[] aligns) {
this(uidl.getIntAttribute("key"));
+ /*
+ * Rendering the rows as hidden improves Firefox and Safari
+ * performance drastically.
+ */
+ getElement().getStyle().setProperty("visibility", "hidden");
+
String rowStyle = uidl.getStringAttribute("rowstyle");
if (rowStyle != null) {
addStyleName(CLASSNAME + "-row-" + rowStyle);