diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2020-04-30 14:31:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 14:31:09 +0300 |
commit | 35e441f2ecf19b779fb99ccc58d658dc29c03d80 (patch) | |
tree | 283089da74a1632264b287c36157b24f28a183a4 /client | |
parent | 4c9a5405a555785dc2b38e82b3d1cda0336491e0 (diff) | |
download | vaadin-framework-35e441f2ecf19b779fb99ccc58d658dc29c03d80.tar.gz vaadin-framework-35e441f2ecf19b779fb99ccc58d658dc29c03d80.zip |
Allow replacing all columns at once when some of them are frozen. (#11978)
Fixes #11824
Diffstat (limited to 'client')
-rwxr-xr-x | client/src/main/java/com/vaadin/client/widgets/Grid.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/client/src/main/java/com/vaadin/client/widgets/Grid.java b/client/src/main/java/com/vaadin/client/widgets/Grid.java index 6d22dfc5ca..2faddaf68d 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -7398,8 +7398,17 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, } private void updateFrozenColumns() { - escalator.getColumnConfiguration() - .setFrozenColumnCount(getVisibleFrozenColumnCount()); + int visibleFrozenColumnCount = getVisibleFrozenColumnCount(); + ColumnConfiguration columnConfiguration = escalator + .getColumnConfiguration(); + if (columnConfiguration.getColumnCount() < visibleFrozenColumnCount) { + // new columns may not have got added yet, delay and check the + // correct count again + Scheduler.get().scheduleFinally(() -> columnConfiguration + .setFrozenColumnCount(getVisibleFrozenColumnCount())); + } else { + columnConfiguration.setFrozenColumnCount(visibleFrozenColumnCount); + } } private int getVisibleFrozenColumnCount() { |