Good morning Alejandro,
i’m using your great component since version 8 and i’d like to move to 14 now.
Everything works well but i’m stuck with renderers.
How can i add, for example, a Date renderer to an existing column? ( i mean in a grid built with GridCrud = new GridCrud<>… )
Is there a way to do it without .addColumn but with .getColumnByKey ?
Maybe i got it under my nose but i can’t see it.
Thank you in advance.
Unfortunately, the setRenderer method was removed. You have to create the column manually.
Hi Alejandro, As above I am trying to render a grid column. The over view in “Use nested properties in GridCrud instances:” has the following example that does not work with 14
crud.getGrid().getColumn(“mainGroup”).setRenderer(group → group == null ? “” : ((Group) group).getName(), new TextRenderer());
I would appreciate a example of how to correctly set the column renderer.
Many Thanks.
You can use one of the addColumn
methods in the Grid
class that accept a Renderer
. For example this one: https://vaadin.com/api/platform/14.1.16/com/vaadin/flow/component/grid/Grid.Column.html.