Set the renderer for a Vaadin 8.1 Grid column?

1.6k views Asked by At

In Vaadin 8.1, the Grid API doc shows that we can pass a renderer as part of the column definition when calling addColumn. But I do not see any setter methods for changing the renderer.

Is there any way to change the renderer on a column in the Grid object?

1

There are 1 answers

0
Basil Bourque On

Column rather than Grid

Call setRenderer on the column rather than the grid.

The column is represented by a class nested inside the grid class, Grid.Column. Pass a column ID to retrieve the particular column.

myGrid.getColumn( someColumnId )

There you call setRenderer.

myGrid.getColumn( someColumnId ).setRenderer( myRenderer ) ;

Replacing the renderer is shown in the Vaadin Framework guide, Grid page, section Column Renderers.