summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java9
-rw-r--r--client/src/com/vaadin/client/ui/table/TableConnector.java10
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