Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

What is a grid renderer?

Grid renderer
0
Posted

What is a grid renderer?

0

Grid renderer is an entity that performs grid headers and content rendering fucntionality. There are default renderers specified for the grids but you can change default implenetations with your own ones. Note that all the grid renderers must implement the same interface: org.gwt.advanced.client.ui.GridRenderer. You can inherit it directly but the best practise is to extend one of defaul implemntations like it’s shown below: public class MyGridRenderer extends DefaultGridRenderer { public MyGridRenderer(EditableGrid grid) { super(grid); } public void drawHeaders(Object[] headers) { //draw simple labels for (int i =0; i < headers.length; i++) { Object header = headers[i]; getGrid().setHeaderWidget(i,new Label(String.valueOf(header))); } } } This sample renders simple headers represented as standard label widgets. Use the EditableGrid.setGridRenderer() method to assign this sample implemntation to your grid.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.