diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-03-31 17:21:12 +0300 |
---|---|---|
committer | Teemu Suo-Anttila <teemusa@vaadin.com> | 2014-04-03 13:36:26 +0000 |
commit | 15e24ec54f0268ed3729c7296556c20cb6fc5f42 (patch) | |
tree | d9078e420581fd68e13b85f4e84129e3001cc754 /client | |
parent | 3d0ff32bea81c3e3c64bd044276ff04a4f8555ed (diff) | |
download | vaadin-framework-15e24ec54f0268ed3729c7296556c20cb6fc5f42.tar.gz vaadin-framework-15e24ec54f0268ed3729c7296556c20cb6fc5f42.zip |
Fix too wide Table columns while sorting from init (#13517)
Change-Id: I2c356c539541381e744c8960d00aa3e018beb67d
Diffstat (limited to 'client')
-rw-r--r-- | client/src/com/vaadin/client/ui/VScrollTable.java | 9 | ||||
-rw-r--r-- | client/src/com/vaadin/client/ui/table/TableConnector.java | 10 |
2 files changed, 11 insertions, 8 deletions
diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 7c22fa2199..261c50b73b 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -1130,6 +1130,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // cell to accomodate for the size of the sort arrow. HeaderCell sortedHeader = tHead.getHeaderCell(sortColumn); if (sortedHeader != null) { + // Mark header as sorted now. Any earlier marking would lead to + // columns with wrong sizes + sortedHeader.setSorted(true); tHead.resizeCaptionContainer(sortedHeader); } // Also recalculate the width of the captionContainer element in the @@ -3329,11 +3332,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (col.hasAttribute("sortable")) { c.setSortable(true); - if (cid.equals(sortColumn)) { - c.setSorted(true); - } else { - c.setSorted(false); - } + c.setSorted(false); } else { c.setSortable(false); } diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java index e8b14955ed..4d7d3c6277 100644 --- a/client/src/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/com/vaadin/client/ui/table/TableConnector.java @@ -303,9 +303,13 @@ public class TableConnector extends AbstractHasComponentsConnector implements getWidget().tabIndex = getState().tabIndex; getWidget().setProperTabIndex(); - if (getWidget().initializedAndAttached) { - getWidget().resizeSortedColumnForSortIndicator(); - } + Scheduler.get().scheduleFinally(new ScheduledCommand() { + + @Override + public void execute() { + getWidget().resizeSortedColumnForSortIndicator(); + } + }); // Remember this to detect situations where overflow hack might be // needed during scrolling |