cancel
Showing results for 
Search instead for 
Did you mean: 

Multipath sorting list in SAP UI5

former_member589109
Participant
0 Kudos

Hello, I would like to sort and group a list using two fields.
For now I have a list in .XML with:

items="{ path: '/CommitteeSet', sorter: { path: 'Bukrs', descending: false, group: true }, groupHeaderFactory: '.getGroupHeader' }

And the getGroupHeader declaration in controller:

getGroupHeader : function (oGroup) {
                return new GroupHeaderListItem({
                    title :  this.getView().getModel("i18n").getResourceBundle().getText("Bukrs") + " " +oGroup.key,
                    upperCase : false
                });
            },

And the result is quite nice, because it groups the list by the Bukrs, but I would like it to be grouped by Audit Id as well(inside the Bukrs groups) or at least to have it sorted by Audit Id and then Commision Id, because for now it looks like that:

SergioG_TX
Active Contributor
0 Kudos

you may be able to achieve that by creating a new calculated field, on your service, that contains the concatenation of the various columns you need to sort by.

Accepted Solutions (1)

Accepted Solutions (1)

ericci
Active Contributor

Hi, I don't think that you can do that. You can have one group (supported only by the first sort item) that is translating in a group by on the odata side.

What you can have instead is multiple sorter in your xml.

Answers (1)

Answers (1)

former_member589109
Participant
0 Kudos

Said List: