Force GroupTable grouping?

For a GroupTable you can define the column the table is potentially grouped by but AFAIK the user has to drag and drop a column. Is there a way to force the table into being grouped by that column and preventing users from changing it?

Also, can you group the table by a custom field?

1 Like

Hi,

you can trigger grouping using GroupDatasource API:


@Inject
private GroupDatasource<Mechanic, UUID> mechanicsDs;
@Inject
private Metadata metadata;
...
MetaClass mechanicMetaClass = metadata.getClassNN(Mechanic.class);
// get meta property and group by this property
mechanicsDs.groupBy(new Object[]{mechanicMetaClass.getPropertyPath("name")});