Editable Grid supports different types of updatale cells
Editable Grid is a most important widget of the library. It extends Simple Grid and provides a wide range of abilities. Being designed in best MVP traditions this component will be simple for undestanding if you have expirience in Java Swing programming. As well as the Swing table component it's described by data model that usally contains custom data and grid display settings like number of pages to be displayed, sorting column and order, total row number, etc. There are two kinds of grid data models:
The grid is able to view both models. It also supports editable (updatable) cells. Any grid cell is a widget that can handle browser events and include complex content. The library provides numerous cell types for different purposes. However if you need your own non-standard cell you can develop a custom implementation and plug it in the grid. Starting from the 1.3.0 version grid rendering has been optimized and currently draws textual reprsentation of the cells instead of widgets insertion. This approach allows saving time and improves rendering perfomance. Note that this kind of rendering is backward compatible and every time a user clicks a cell the grid changes textual representation to a widget automacally. So advanced features of the grid weren't lost. You can also use server side rendering. Sometimes it works much faster. Even in this case cells editing features will be available. Sample of the source code that demonstrates how to create a new grid can be found in the Quick Start.
Paging, sorting and rows management capabilities are the key features of the grid
Main features of the widget are:
The next sample demonstrates how to create a new Editable Grid and a Grid Panel and put them into a root panel. Note that the last step is important otherwise you won't see anything since the GridPanel.display() method prepares widgets for displaying but doesn't display them in fact.
Editable model = new EditableGridDataModel(null); // create a new grid panel GridPanel panel = new GridPanel(); // create a new editable grid and put it into the panel EditableGrid grid = panel.createEditableGrid ( new String[]{"First Name", "Surname"}, new Class[]{LabelCell.class, LabelCell.class}, model ); // display all panel.display(); RootPanel.get().add(panel);