Grouping records in a grid provides a very simple yet powerful way to make meaningful deductions quickly from potentially large data. In a company stock data sheet grid, we could group the records by industry so that companies will be grouped together by their respective industries.
Create a grid with ColumnModel
from ColumnConfig
objects, and GroupingStore
instead of a regular ListStore
, then set the column on which to perform the grouping operation using the groupBy()
method of the GroupingStore
class. Finally, set the grid's view to a GroupingView
which extends the standard GridView
class to provide specialized rendering for record grouping in a GXT Grid
.
@Override public void onModuleLoad() { // A list for the column configurations // Create columns as ColumnConfig objects, then add to the list List<ColumnConfig> config = new ArrayList<ColumnConfig>(); ColumnConfig company = new ColumnConfig("name", "Company", 60); config.add(company...