我想更改 Column
的默认排序,以便它仅在第一层按字母顺序排序,并在其余层按 jcr 节点排序。
老实说,我不知道从哪里开始。首先,我尝试扩展现有的 TreePresenterDefinition,但很快我意识到这是错误的方式。
目前,我尝试扩展 PropertyColumnDefinition
并编写自己的 ColumnFormatter
。
谁能给我一个研究方向?
祝愿, hell 恶魔
最佳答案
很可能您应该接触容器,例如,可以为您的应用程序扩展AbstractJcrContainer,并根据您的意愿设置排序,基本上可以遵循这种方式; (瓦丁方式)
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) {
}
}));
希望这有帮助,
干杯,
关于java - Magnolia 5.4.7 更改列排序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38501087/