From 629f2ddccf337a11460e2c861249351c263fb9ae Mon Sep 17 00:00:00 2001 From: Anastasia Smirnova Date: Fri, 20 Apr 2018 10:00:57 +0300 Subject: Update example for Comparator in Grid (#10833) Fixes #10337 --- documentation/datamodel/datamodel-providers.asciidoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/documentation/datamodel/datamodel-providers.asciidoc b/documentation/datamodel/datamodel-providers.asciidoc index 9b3c4dadd0..e4e16df24f 100644 --- a/documentation/datamodel/datamodel-providers.asciidoc +++ b/documentation/datamodel/datamodel-providers.asciidoc @@ -58,10 +58,10 @@ We can also define a custom [classname]#Comparator# if we want to customize the [source, java] ---- -grid.addColumn("Name", Person::getName) +grid.addColumn(Person::getName).setCaption("Name") // Override default natural sorting - .setComparator(Comparator.comparing( - person -> person.getName().toLowerCase())); + .setComparator( + Comparator.comparing(Person::getName)::compare); ---- [NOTE] -- cgit v1.2.3