You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enum columns sort by ordinal (natural) order, not alphabetically as documented #13
SPECIFICATIONS.md §2.2 (Type-to-Renderer Mapping) lists the Sorting for Enum<?> columns as "Alphabetical", but the implementation sorts enum columns by the enum's natural order (Enum.compareTo, i.e. declaration / ordinal() order). The two only coincide when the constants happen to be declared in alphabetical order.
Details
For sortable columns, EasyGrid installs an in-memory comparator built from the column's ValueProvider whenever the value type is Comparable or a primitive (EasyGridWrapper#createEasyColumn):
if (Comparable.class.isAssignableFrom(type) || type.isPrimitive()) {
column.setComparator((ValueProvider) getter);
}
Enum implements Comparable, so enum columns receive a natural-order comparator and therefore sort by ordinal() — not alphabetically.
(Enum rendering is correct per spec: it uses Enum.toString(), not Enum.name().)
Activity
javier-godoy commentedon Nov 10, 2026
Closing as part of a personal cleanup of projects I'm no longer involved in. This does not imply that the underlying issue has been resolved.