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.
  • Method Details

    • getProperty

      GroupProperty getProperty()
      Returns:
      the property to be used for grouping
    • getValueProvider

      Returns:
      a function that provides the value of the custom property for the given item
    • getSortProperties

      default List<String> getSortProperties()
      Returns:
      a list of properties that should be used for sorting the group property