Browse Source

Fix too wide Table columns while sorting from init (#13517)

Change-Id: I2c356c539541381e744c8960d00aa3e018beb67d
tags/7.1.14
Teemu Suo-Anttila 10 years ago
parent
commit
15e24ec54f

+ 4
- 5
client/src/com/vaadin/client/ui/VScrollTable.java View File

// cell to accomodate for the size of the sort arrow. // cell to accomodate for the size of the sort arrow.
HeaderCell sortedHeader = tHead.getHeaderCell(sortColumn); HeaderCell sortedHeader = tHead.getHeaderCell(sortColumn);
if (sortedHeader != null) { if (sortedHeader != null) {
// Mark header as sorted now. Any earlier marking would lead to
// columns with wrong sizes
sortedHeader.setSorted(true);
tHead.resizeCaptionContainer(sortedHeader); tHead.resizeCaptionContainer(sortedHeader);
} }
// Also recalculate the width of the captionContainer element in the // Also recalculate the width of the captionContainer element in the


if (col.hasAttribute("sortable")) { if (col.hasAttribute("sortable")) {
c.setSortable(true); c.setSortable(true);
if (cid.equals(sortColumn)) {
c.setSorted(true);
} else {
c.setSorted(false);
}
c.setSorted(false);
} else { } else {
c.setSortable(false); c.setSortable(false);
} }

+ 7
- 3
client/src/com/vaadin/client/ui/table/TableConnector.java View File

getWidget().tabIndex = getState().tabIndex; getWidget().tabIndex = getState().tabIndex;
getWidget().setProperTabIndex(); 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 // Remember this to detect situations where overflow hack might be
// needed during scrolling // needed during scrolling

Loading…
Cancel
Save