summaryrefslogtreecommitdiffstats
path: root/documentation/components
diff options
context:
space:
mode:
authorArtur <artur@vaadin.com>2017-01-30 13:47:55 +0200
committerGitHub <noreply@github.com>2017-01-30 13:47:55 +0200
commit131e4f34bddf99d61a76fcd49890490c78c3efa8 (patch)
tree1276e94ddbec6a8fc612bedf87835cd366e5f0a5 /documentation/components
parent870a4d9ab386de41b0c5e344d16ebfd9c13b2951 (diff)
downloadvaadin-framework-131e4f34bddf99d61a76fcd49890490c78c3efa8.tar.gz
vaadin-framework-131e4f34bddf99d61a76fcd49890490c78c3efa8.zip
Make it possible to disallow user selection in Grid (#8144)
Fixes #7880
Diffstat (limited to 'documentation/components')
-rw-r--r--documentation/components/components-grid.asciidoc13
1 files changed, 13 insertions, 0 deletions
diff --git a/documentation/components/components-grid.asciidoc b/documentation/components/components-grid.asciidoc
index 9b465a71b0..931c50ee2a 100644
--- a/documentation/components/components-grid.asciidoc
+++ b/documentation/components/components-grid.asciidoc
@@ -327,6 +327,19 @@ grid.addSelectionListener(selection -> { // Java 8
});
----
+[[components.grid.selection.disallowuser]]
+=== Disallowing User Selection
+It is possible to prevent the user from changing the selection in grid for both single- and multi-selection models:
+
+[source, java]
+----
+HasUserSelectionAllowed model = (HasUserSelectionAllowed) grid.getSelectionModel();
+model.setUserSelectionAllowed(false);
+----
+
+[NOTE]
+Both `SingleSelectionModel` and `MultiSelectModel` implement `HasUserSelectionAllowed` so the cast is generally safe.
+
[[components.grid.selection.clicks]]
=== Focus and Clicks