use of com.vaadin.flow.data.renderer.ComponentRenderer in project flow-components by vaadin.
the class GridWithTemplatePage method createStandaloneGridWithTemplatesInTheDetails.
private void createStandaloneGridWithTemplatesInTheDetails() {
Grid<String> grid = new Grid<>();
setCommonGridFeatures(grid, "standalone-template-in-details");
grid.addColumn(value -> value);
grid.setItemDetailsRenderer(new ComponentRenderer<>(value -> getTestTemplate(value, grid.getId().get())));
add(new H3("Grid with templates in the details"), grid);
}
use of com.vaadin.flow.data.renderer.ComponentRenderer in project flow-components by vaadin.
the class GridWithTemplatePage method createStandaloneGridWithColumnProperties.
private void createStandaloneGridWithColumnProperties() {
Grid<String> grid = new Grid<>();
setCommonGridFeatures(grid, "standalone-columns-with-properties");
grid.addColumn(value -> value).setFlexGrow(2);
grid.addColumn(TemplateRenderer.of("[[index]]")).setFlexGrow(0).setWidth("20px");
grid.addColumn(new ComponentRenderer<>(value -> getTestTemplate(value, grid.getId().get()))).setFrozen(true).setResizable(true);
add(new H3("Grid with column properties"), grid);
}
use of com.vaadin.flow.data.renderer.ComponentRenderer in project flow-components by vaadin.
the class OverrideClientValidationPage method createGridSetup.
private void createGridSetup() {
selectInGrid = new Select<>();
Grid<String> grid = new Grid<>();
grid.setItems("test");
grid.addColumn(new ComponentRenderer<>(item -> selectInGrid, (component, item) -> component));
add(new H1("Grid select usage"), grid);
}
use of com.vaadin.flow.data.renderer.ComponentRenderer in project flow-components by vaadin.
the class TimePickerPage method createTimePickerFromRenderer.
private void createTimePickerFromRenderer() {
ComponentRenderer<TimePicker, TimePickerPage> renderer = new ComponentRenderer<>(() -> {
TimePicker timePicker = new TimePicker();
timePicker.setValue(LocalTime.now());
return timePicker;
});
renderer.render(getElement(), null);
}
Aggregations