Implemented sorting node list

This commit is contained in:
Andrey Terentev 2024-02-14 17:25:38 +07:00 committed by Andrey Terentev
parent ef6ab38ed2
commit bbbcc64abe

View File

@ -57,9 +57,12 @@ public class NodeList extends VerticalLayout {
private Grid<RNode> createGrid() { private Grid<RNode> createGrid() {
var grid = new Grid<>(RNode.class, false); var grid = new Grid<>(RNode.class, false);
grid.addColumn(RNode::getId).setHeader("Identifier");
grid.addColumn(node -> node.getMode().getName()).setHeader("Mode"); grid.addColumn(RNode::getId).setHeader("Identifier").setSortable(true);
grid.addColumn(node -> node.getMode().getName()).setHeader("Mode").setSortable(true);
grid.addComponentColumn(this::createManageButtons).setHeader("Manage"); grid.addComponentColumn(this::createManageButtons).setHeader("Manage");
grid.setMultiSort(true, Grid.MultiSortPriority.APPEND);
return grid; return grid;
} }