如何订购Vaadin Table Rows?

Nor*_*man 5 java sql vaadin

我有一个表阶段,其值具有引用存储库表的值.在存储库中,每个值都有一个订单号.

通常在SQL中,我会加入它们,然后按顺序列排序.但是,如果我想在Vaadin中这样做,我必须使用它FreeFormQuery来进行此连接.

问题是我想允许用户更改表阶段中的值.所以我需要实现FreeFormQueryDelegate.有没有办法通过使用标准TableQuery而不是FreeFormQuery?来完成这项工作?

也许手动移动表中的行?

nex*_*xus 15

Vaadin为表提供了一些排序选项.

您可以对一个特定的propertyId进行排序,也可以对一组属性进行排序.

// sort one container property Id
table.setSortContainerPropertyId(propertyId);
table.setSortAscending(ascending);
table.sort();

// sort several property Ids
table.sort(propertyId[], ascending[]);
Run Code Online (Sandbox Code Playgroud)

注意:上面的代码没有正确的代码,而是显示方法体.