aboutsummaryrefslogtreecommitdiffstats
path: root/client/src
diff options
context:
space:
mode:
authorSauli Tähkäpää <sauli@vaadin.com>2015-08-29 23:00:21 +0300
committerVaadin Code Review <review@vaadin.com>2015-11-30 12:19:27 +0000
commitb021d6199acd666abc729c6c20eaf68b820d1bdb (patch)
tree10ec789491b08d3d9aeba066634f8a387a222763 /client/src
parentd337dc824cfcbd8826bc96b90bef1cefc3f964c4 (diff)
downloadvaadin-framework-b021d6199acd666abc729c6c20eaf68b820d1bdb.tar.gz
vaadin-framework-b021d6199acd666abc729c6c20eaf68b820d1bdb.zip
Unify select all behavior with single row selection. (#17742)
Change-Id: I6481bf6f429046166dd0502a62b22aea51f5a0bd
Diffstat (limited to 'client/src')
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 7086ff86d2..065ba411d8 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -2846,6 +2846,18 @@ public class Grid<T> extends ResizeComposite implements
});
selectAllCheckBox.setValue(selected);
+ addHeaderClickHandler(new HeaderClickHandler() {
+ @Override
+ public void onClick(GridClickEvent event) {
+ CellReference<?> targetCell = event.getTargetCell();
+ int defaultRowIndex = getHeader().getRows().indexOf(getDefaultHeaderRow());
+
+ if(targetCell.getColumnIndex() == 0 && targetCell.getRowIndex() == defaultRowIndex) {
+ selectAllCheckBox.setValue(!selectAllCheckBox.getValue(), true);
+ }
+ }
+ });
+
// Select all with space when "select all" cell is active
addHeaderKeyUpHandler(new HeaderKeyUpHandler() {
@Override