Goktug Gokdogan has submitted this change and it was merged.

Change subject: Update how columns are hidden in CellTable.
......................................................................


Update how columns are hidden in CellTable.

Hide columns that shouldn't be visible by setting display to none.
This is to fix a rendering issue in safari and chrome, where the column
is hidden, but doesn't allow the other columns to expand to fill the
remaining space.

Original patch by: Aliseya Wright

Change-Id: I49fd531a02ca0a1a55eabba5548670ad86273a43
Review-Link: https://gwt-review.googlesource.com/#/c/3130/
---
M user/src/com/google/gwt/user/cellview/client/CellTable.java
M user/test/com/google/gwt/user/cellview/client/CellTableTest.java
2 files changed, 6 insertions(+), 5 deletions(-)

Approvals:
  Leeroy Jenkins: Verified
  Jens Nehlmeier: Looks good to me, but someone else must approve
  Brian Slesinsky: Looks good to me, approved



diff --git a/user/src/com/google/gwt/user/cellview/client/CellTable.java b/user/src/com/google/gwt/user/cellview/client/CellTable.java
index 12b3db2..355f960 100644
--- a/user/src/com/google/gwt/user/cellview/client/CellTable.java
+++ b/user/src/com/google/gwt/user/cellview/client/CellTable.java
@@ -824,11 +824,11 @@
// enabled), and refreshColumnWidth/clearColumnWidth. The latter two are no op if setColumnWidth
     // is not invoked first.
     if (colGroupEnabled) {
-      if (width == null) {
-        ensureTableColElement(column).getStyle().clearWidth();
-      } else {
- ensureTableColElement(column).getStyle().setProperty("width", width);
-      }
+      TableColElement columnElement = ensureTableColElement(column);
+ columnElement.getStyle().setProperty("width", width == null ? "" : width);
+
+      boolean isColumnVisible = !"0".equals(width) && !"0px".equals(width);
+      setVisible(columnElement, isColumnVisible);
     }
   }

diff --git a/user/test/com/google/gwt/user/cellview/client/CellTableTest.java b/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
index c54266f..e214e3d 100644
--- a/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
+++ b/user/test/com/google/gwt/user/cellview/client/CellTableTest.java
@@ -297,6 +297,7 @@
     table.removeColumn(column1);
     table.getPresenter().flush();
     assertEquals("0px", col1.getStyle().getWidth());
+    assertEquals("none", col1.getStyle().getDisplay());
   }

   @Override

--
To view, visit https://gwt-review.googlesource.com/3130
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I49fd531a02ca0a1a55eabba5548670ad86273a43
Gerrit-PatchSet: 3
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Goktug Gokdogan <[email protected]>
Gerrit-Reviewer: Brian Slesinsky <[email protected]>
Gerrit-Reviewer: Goktug Gokdogan <[email protected]>
Gerrit-Reviewer: Jens Nehlmeier <[email protected]>
Gerrit-Reviewer: Leeroy Jenkins <[email protected]>

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to