In the doc Data model / Showing many Items in a Listing there is an example that it uses a grid to show a list of person and try to short with comparator the column of name.
grid.addColumn("Name", Person::getName)
.setComparator(Comparator.comparing(
person -> person.getName().toLowerCase()));
When i try do it the same Eclipse indicate an error about the method addColumn but i don’t know exactly why.
Eclipse says that the methos is not applicable for those arguments.
In the API it is
public Grid.Column<T,?> addColumn(String propertyName, AbstractRenderer<? super T,?> renderer)
grid.addColumn("Name", Person::getName)
// Override default natural sorting
.setComparator(Comparator.comparing(
person -> person.getName().toLowerCase()));
I use Vaadin 8.1.6 and the method that you mention in your message isn’t in the API.
grid.addColumn(Person::getname).setCaption(“name”)
return a Grid.column<V,T> class
This class has not addComparator method but also setCompator