I have two problems with a sap.m.List
. I'm trying to group values by a given date.
- The grouping shows duplicates group headers, despite having the same values.
- The actual list items are not showing at all.
I'm binding everything in the controller. When I remove the sorter, the list behaves correctly and shows all data correctly. But as soon as I add the grouping, the list breaks.
XML View (the item is more complex, for simplicity all other variables have been removed):
<List id="idListCart" noDataText="{i18n>CartListNoData}">
<CustomListItem id="listItemTemplate">
<layout:Grid class="sapUiSmallMarginTop" hSpacing="1">
<VBox alignItems="Start" class="sapUiSmallMarginEnd">
<Text text="{Fullname}" />
<Text text="{Startdatum}" />
</VBox>
</layout:Grid>
</CustomListItem>
</List>
Controller:
this.byId("idListCart").bindItems({
path: "/CartSet",
template: this.byId("listItemTemplate"),
filters: aFilters,
sorter: new Sorter({ // required from "sap/ui/model/Sorter"
path: "Startdatum",
group: function(oContext) {
return /* formatted date */;
}
}),
groupHeaderFactory: function(oGroup) {
return new GroupHeaderListItem({ // required from "sap/m/GroupHeaderListItem"
title: oGroup.key
});
},
});
Any ideas what I am doing wrong?
question from:https://stackoverflow.com/questions/65876663/list-control-breaks-after-grouping-aggregation