// 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
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);
}
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