diff options
author | Ilia Motornyi <elmot@vaadin.com> | 2017-04-05 14:14:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 14:14:03 +0200 |
commit | 535b879cb8180983c2da6444ec275e588fb4125f (patch) | |
tree | b92535ccbc9bd9f43b1000a73fcf2d5bf9223a30 /documentation | |
parent | 1a30320913e8b9ea851af3ed4a659f969aa92ee6 (diff) | |
download | vaadin-framework-535b879cb8180983c2da6444ec275e588fb4125f.tar.gz vaadin-framework-535b879cb8180983c2da6444ec275e588fb4125f.zip |
TreeGrid keyboard navigation
Fixes #8758
Diffstat (limited to 'documentation')
-rw-r--r-- | documentation/components/components-treegrid.asciidoc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/documentation/components/components-treegrid.asciidoc b/documentation/components/components-treegrid.asciidoc index f3c2058f03..98d3d17839 100644 --- a/documentation/components/components-treegrid.asciidoc +++ b/documentation/components/components-treegrid.asciidoc @@ -93,6 +93,7 @@ treeGrid.addColumn(Project::getHoursDone).setCaption("Hours Done"); treeGrid.setHierarchyColumn("name"); ---- +[[components.treegrid.node.collapsing]] == Prevent Node Collapsing [classname]#TreeGrid# supports setting a callback method that can allow or prevent the user from collapsing an expanded node. @@ -105,10 +106,11 @@ Example using a predefined set of persons that can not be collapsed: [source, java] ---- Set<Person> alwaysExpanded; -personTreeGrid.setItemCollapseAllowedProvider(person -> +personTreeGrid.setItemCollapseAllowedProvider(person -> !alwaysExpanded.contains(person)); ---- +[[components.treegrid.events]] == Listening to Events In addition to supporting all the listeners of the standard [classname]#Grid#, [classname]#TreeGrid# supports listening to the expansion and collapsing of items in its hierarchy. @@ -122,3 +124,10 @@ treeGrid.addCollapseListener(event -> log("Item collapsed: " + event.getCollapse The return types of the methods `getExpandedItem` and `getCollapsedItem` are the same as the type of the [classname]#TreeGrid# the events originated from. Note that collapse listeners will not be triggered for any expanded subtrees of the collapsed item. + +[[components.treegrid.keyboard]] +== Keyboard Navigation and Focus Handling in TreeGrid + +As opposed to [classname]#Grid#, individual cells are not focusable in [classname]#TreeGrid#, and only whole rows +receive focus. The user can navigate through rows with kbd:[Up] and kbd:[Down], collapse rows with kbd:[Left], +and expand them with kbd:[Right]. |