Interface GroupPropertyDescriptor<E>
- Type Parameters:
E- item type
- All Known Implementing Classes:
BaseGroupPropertyDescriptor
public interface GroupPropertyDescriptor<E>
Describes a property that can be used to group items.
For instance, the group data grid contains a column not bound with a property of the entity. To enable grouping
by this column, a custom GroupPropertyDescriptor must be provided. If the column defines the "fullName" key,
the following code can be used:
customersDataGrid.getItems().addGroupPropertyDescriptor(
new BaseGroupPropertyDescriptor<Customer>("fullName", context -> {
Customer item = context.getItem();
return item.getFirstName() + " " + item.getLastName();
}).withSortProperties(List.of("firstName", "lastName")));
Note, the BaseGroupPropertyDescriptor is available in the group data grid addon.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classThe context provides information about an item and its associated grouping property. -
Method Summary
Modifier and TypeMethodDescription
-
Method Details
-
getProperty
GroupProperty getProperty()- Returns:
- the property to be used for grouping
-
getValueProvider
Function<GroupPropertyDescriptor.GroupValueContext<E>,Object> getValueProvider()- Returns:
- a function that provides the value of the custom property for the given item
-
getSortProperties
- Returns:
- a list of properties that should be used for sorting the group property
-