use of com.haulmont.cuba.gui.data.CollectionDatasource.Sortable.SortInfo in project cuba by cuba-platform.
the class SortableCollectionDsWrapper method sort.
@Override
public void sort(Object[] propertyId, boolean[] ascending) {
List<SortInfo> infos = new LinkedList<>();
for (int i = 0; i < propertyId.length; i++) {
final MetaPropertyPath propertyPath = (MetaPropertyPath) propertyId[i];
final SortInfo<MetaPropertyPath> info = new SortInfo<>();
info.setPropertyPath(propertyPath);
info.setOrder(ascending[i] ? Order.ASC : Order.DESC);
infos.add(info);
}
SortInfo[] sortInfos = infos.toArray(new SortInfo[infos.size()]);
((CollectionDatasource.Sortable) datasource).sort(sortInfos);
}
use of com.haulmont.cuba.gui.data.CollectionDatasource.Sortable.SortInfo in project cuba by cuba-platform.
the class SortableDataGridIndexedCollectionDsWrapper method sort.
@Override
public void sort(Object[] propertyId, boolean[] ascending) {
List<SortInfo> infos = new LinkedList<>();
for (int i = 0; i < propertyId.length; i++) {
final MetaPropertyPath propertyPath = (MetaPropertyPath) propertyId[i];
final SortInfo<MetaPropertyPath> info = new SortInfo<>();
info.setPropertyPath(propertyPath);
info.setOrder(ascending[i] ? Order.ASC : Order.DESC);
infos.add(info);
}
SortInfo[] sortInfos = infos.toArray(new SortInfo[infos.size()]);
((CollectionDatasource.Sortable) datasource).sort(sortInfos);
}
Aggregations