Просмотр исходного кода

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

Change-Id: I2c356c539541381e744c8960d00aa3e018beb67d
tags/7.1.14
Teemu Suo-Anttila 10 лет назад
Родитель
Сommit
15e24ec54f

+ 4
- 5
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);
}

+ 7
- 3
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

Загрузка…
Отмена
Сохранить