Button renderer
Template-based button renderer for Vaadin 10+
Show buttons in Grid cells efficiently thanks to using a template renderer instead of a button renderer. You can configure the caption, icons, styles and whether the button on each row is enabled.
Sample code
grid.addColumn(ButtonRendererBuilder.create("Click me", item -> Notification.show("You clicked " + item)));
grid.addColumn( new ButtonRendererBuilder<>(Item::promote) .withCaption("Promote") .withIconSuffix(VaadinIcon.LEVEL_UP_BOLD) .withEnabledGenerator(Item::canBePromoted) .withStyle("width: 100%") .build() );
grid.addColumn( new ButtonRendererBuilder<Item>(item -> System.out.println(item.getIcon().name())) .withIconPrefix(item -> item.getIcon().create()) .withCaption(item -> item.getIcon().name()) .withStyle(item -> "--lumo-border-radius: " + 10 * (item.id % 3) + "px") .build() );
Links
Compatibility
Was this helpful? Need more help?
Leave a comment or a question below. You can also join
the chat on Discord or
ask questions on StackOverflow.
Version
Initial version
- Released
- 2019-12-11
- Maturity
- STABLE
- License
- Apache License 2.0
Compatibility
- Framework
- Vaadin 10+
- Browser
- Browser Independent
Button renderer - Vaadin Add-on Directory
Template-based button renderer for Vaadin 10+Show buttons in Grid cells efficiently thanks to using a template renderer instead of a button renderer. You can configure the caption, icons, styles and whether the button on each row is enabled.
View on GitHubButton renderer version 1.0.0
Initial version