Magnolia 5.4.7 更改列排序
Magnolia 5.4.7 Change Column Sortation
我想更改 Column
的默认排序方式,使其仅在第一层按字母顺序排序,在其余层按 jcr 节点排序。
老实说,我不知道从哪里开始。首先我尝试扩展现有的 TreePresenterDefinition
,但很快我意识到这是错误的方法。
目前我尝试扩展 PropertyColumnDefinition
并编写我自己的 ColumnFormatter
.
谁能给我一个方向看看?
祝福,
地狱魔
很可能您应该接触 Containers,例如,可以为您的应用程序扩展 AbstractJcrContainer 并根据需要在那里设置排序基本上可以按照这种方式进行; (Vaadin 方式)
IndexedContainer ic = new IndexedContainer() {
@Override
public Collection<?> getSortableContainerPropertyIds() {
// Default implementation allows sorting only if the property
// type can be cast to Comparable
return getContainerPropertyIds();
}
};
ic.setItemSorter(new DefaultItemSorter(new Comparator<Object>() {
public int compare(Object o1, Object o2) {
}
}));
希望对您有所帮助,
干杯,
我想更改 Column
的默认排序方式,使其仅在第一层按字母顺序排序,在其余层按 jcr 节点排序。
老实说,我不知道从哪里开始。首先我尝试扩展现有的 TreePresenterDefinition
,但很快我意识到这是错误的方法。
目前我尝试扩展 PropertyColumnDefinition
并编写我自己的 ColumnFormatter
.
谁能给我一个方向看看?
祝福, 地狱魔
很可能您应该接触 Containers,例如,可以为您的应用程序扩展 AbstractJcrContainer 并根据需要在那里设置排序基本上可以按照这种方式进行; (Vaadin 方式)
IndexedContainer ic = new IndexedContainer() {
@Override
public Collection<?> getSortableContainerPropertyIds() {
// Default implementation allows sorting only if the property
// type can be cast to Comparable
return getContainerPropertyIds();
}
};
ic.setItemSorter(new DefaultItemSorter(new Comparator<Object>() {
public int compare(Object o1, Object o2) {
}
}));
希望对您有所帮助,
干杯,