use of com.vaadin.flow.component.grid.it.GridInATemplate in project flow-components by vaadin.
the class ContextMenuGridPage method gridInATemplateWithContextMenu.
private void gridInATemplateWithContextMenu() {
GridInATemplate template = new GridInATemplate();
Grid<String> gridInATemplate = template.getGrid();
gridInATemplate.addColumn(s -> s).setHeader("Item");
gridInATemplate.setItems(IntStream.range(0, 26).mapToObj(i -> "Item " + i));
GridContextMenu<String> contextMenu = gridInATemplate.addContextMenu();
contextMenu.addItem("Show name of context menu target item", e -> message.setText(e.getItem().orElse(NO_TARGET_ITEM)));
add(template);
}
Aggregations