diff options
author | Tarek Oraby <42799254+tarekoraby@users.noreply.github.com> | 2020-06-18 08:41:19 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-18 08:41:19 +0300 |
commit | d824efe59a71e2eb3e554873a32d92ca5d34cc5e (patch) | |
tree | b9deefb270d79ba4163e0f2a8e2cb66be72b446d /client/src | |
parent | 9e8671890a721330aaf621e24159f53762f9827f (diff) | |
download | vaadin-framework-d824efe59a71e2eb3e554873a32d92ca5d34cc5e.tar.gz vaadin-framework-d824efe59a71e2eb3e554873a32d92ca5d34cc5e.zip |
Fix rendering of TreeGrid's frozen columns after hierarchy-column reset (#12028)
* Add tests
* Fix getVisibleFrozenColumnCount() if SelectionMode is multi
Diffstat (limited to 'client/src')
-rwxr-xr-x | client/src/main/java/com/vaadin/client/widgets/Grid.java | 10 |
1 files changed, 9 insertions, 1 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 2faddaf68d..9f36864bc8 100755 --- a/client/src/main/java/com/vaadin/client/widgets/Grid.java +++ b/client/src/main/java/com/vaadin/client/widgets/Grid.java @@ -7416,7 +7416,15 @@ public class Grid<T> extends ResizeComposite implements HasSelectionHandlers<T>, // for the escalator the hidden columns are not in the frozen column // count, but for grid they are. thus need to convert the index - for (int i = 0; i < frozenColumnCount; i++) { + int limit = getFrozenColumnCount(); + if (getSelectionColumn().isPresent()) { + // If the grid is in MultiSelect mode, getColumn(0) in the following + // for loop returns the selection column. Accordingly, verifying + // which frozen columns are visible if the selection column is + // present should take this fact into account. + limit++; + } + for (int i = 0; i < limit; i++) { if (i >= getColumnCount() || getColumn(i).isHidden()) { numberOfColumns--; } |