diff options
author | Leif Åstrand <leif@vaadin.com> | 2013-03-13 09:50:41 +0200 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2013-03-14 11:01:55 +0000 |
commit | d2d4279e9946f9b193c0b706ecad9e01a5bf77c3 (patch) | |
tree | 86cd1107710b66192ecd49ae5a1451556b3efab1 /client | |
parent | 749fd7085ec2db6af0b4f401378b2694be3626c7 (diff) | |
download | vaadin-framework-d2d4279e9946f9b193c0b706ecad9e01a5bf77c3.tar.gz vaadin-framework-d2d4279e9946f9b193c0b706ecad9e01a5bf77c3.zip |
Fixed setting column width back to undefined by setting it to -1. #7922
svn changeset:25591/svn branch:6.8
Conflicts:
server/src/com/vaadin/ui/Table.java
Reverted change included by mistake in changeset [25591] for #7922
svn changeset:25606/svn branch:6.8
Change-Id: I6765a52ab213c131cca053227ee72b0007552f7f
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 6f9fd6da88..4d61fba429 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -3056,7 +3056,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, .hasNext(); columnIndex++) { if (it.next() == this) { break; - } + } } } final int cw = scrollBody.getColWidth(columnIndex); @@ -3266,10 +3266,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (col.hasAttribute("width")) { - final String widthStr = col.getStringAttribute("width"); // Make sure to accomodate for the sort indicator if // necessary. - int width = Integer.parseInt(widthStr); + int width = col.getIntAttribute("width"); int widthWithoutAddedIndent = width; // get min width with indent, no padding @@ -3301,12 +3300,25 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // save min width without indent c.setWidth(widthWithoutAddedIndent, true); } + } else if (col.hasAttribute("er")) { + c.setExpandRatio(col.getFloatAttribute("er")); + } else if (recalcWidths) { c.setUndefinedWidth(); + + } else { + boolean hadExpandRatio = c.getExpandRatio() > 0; + boolean hadDefinedWidth = c.isDefinedWidth(); + if (hadExpandRatio || hadDefinedWidth) { + // Someone has removed a expand width or the defined + // width on the server side (setting it to -1), make the + // column undefined again and measure columns again. + c.setUndefinedWidth(); + c.setExpandRatio(0); + refreshContentWidths = true; + } } - if (col.hasAttribute("er")) { - c.setExpandRatio(col.getFloatAttribute("er")); - } + if (col.hasAttribute("collapsed")) { // ensure header is properly removed from parent (case when // collapsing happens via servers side api) |